cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r916080 [2/2] - in /cxf/trunk: api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/common/util/ rt/bindings/soap/src...
Date Thu, 25 Feb 2010 01:22:37 GMT
Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java Thu Feb 25 01:22:34 2010
@@ -84,6 +84,15 @@
     private List<WebServiceFeature> wsFeatures;
     private List<AbstractFeature> features;
     
+    //interceptors added/removed to chains as needed
+    private SOAPHandlerInterceptor soapHandlerInterceptor;
+    private LogicalHandlerInInterceptor logicalInInterceptor;
+    private LogicalHandlerOutInterceptor logicalOutInterceptor;
+    private LogicalHandlerFaultOutInterceptor logicalFaultOutInterceptor;
+    private SOAPHandlerFaultOutInterceptor soapFaultOutInterceptor;
+    private LogicalHandlerFaultInInterceptor logicalFaultInInterceptor;
+    private SOAPHandlerFaultInInterceptor soapFaultInInterceptor;
+    
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei) throws EndpointException {
         this(bus, s, ei, null, null, null, true);
     }
@@ -118,13 +127,13 @@
         }
 
         // Inbound chain
-        in.add(new LogicalHandlerInInterceptor(jaxwsBinding));
+        logicalInInterceptor = new LogicalHandlerInInterceptor(jaxwsBinding);
         if (!isProvider) {
             in.add(new WrapperClassInInterceptor());
             in.add(new HolderInInterceptor());
         }
         if (getBinding() instanceof SoapBinding) {
-            in.add(new SOAPHandlerInterceptor(jaxwsBinding));
+            soapHandlerInterceptor = new SOAPHandlerInterceptor(jaxwsBinding);
             in.add(new SwAInInterceptor());
             getOutInterceptors().add(new SwAOutInterceptor());
             if (isProvider && mode == Mode.MESSAGE) {
@@ -136,38 +145,28 @@
         }
 
         // Outbound chain
-        out.add(new LogicalHandlerOutInterceptor(jaxwsBinding));
+        logicalOutInterceptor = new LogicalHandlerOutInterceptor(jaxwsBinding);
         if (!isProvider) {
             out.add(new WrapperClassOutInterceptor());
             out.add(new HolderOutInterceptor());
         }
-        if (getBinding() instanceof SoapBinding) {
-            out.add(new SOAPHandlerInterceptor(jaxwsBinding));
-            if (mode == Mode.MESSAGE) {
-                SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
-                out.add(saajOut);
-                out.add(new MessageModeOutInterceptor(saajOut,
-                                                      getBinding().getBindingInfo().getName()));
-            }
+        if (getBinding() instanceof SoapBinding && mode == Mode.MESSAGE) {
+            SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
+            out.add(saajOut);
+            out.add(new MessageModeOutInterceptor(saajOut,
+                                                  getBinding().getBindingInfo().getName()));
         } else if (isProvider) {
             out.add(new MessageModeOutInterceptor(clazz, getBinding().getBindingInfo().getName()));
         }
+
+        logicalFaultOutInterceptor = new LogicalHandlerFaultOutInterceptor(jaxwsBinding);
+        logicalFaultInInterceptor = new LogicalHandlerFaultInInterceptor(jaxwsBinding);
         
-        //Outbound fault chain
-        List<Interceptor<? extends Message>> outFault = super.getOutFaultInterceptors();    
-        outFault.add(new LogicalHandlerFaultOutInterceptor(jaxwsBinding));
         if (getBinding() instanceof SoapBinding) {
-            outFault.add(new SOAPHandlerFaultOutInterceptor(jaxwsBinding));
+            soapFaultOutInterceptor = new SOAPHandlerFaultOutInterceptor(jaxwsBinding);
+            soapFaultInInterceptor = new SOAPHandlerFaultInInterceptor(jaxwsBinding);
         }
 
-        //Inbound fault chain
-        List<Interceptor<? extends Message>> inFault = super.getInFaultInterceptors(); 
-        inFault.add(new LogicalHandlerFaultInInterceptor(jaxwsBinding));
-        if (getBinding() instanceof SoapBinding) {
-            inFault.add(new SOAPHandlerFaultInInterceptor(jaxwsBinding));
-        }
-        
-        
         if (ei != null) {
             if (!isFromWsdl) {
                 buildWsdlExtensibilities(ei.getBinding());
@@ -326,18 +325,60 @@
     
     final void createJaxwsBinding() {
         if (getBinding() instanceof SoapBinding) {
-            jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding());
+            jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding(), this);
             MTOMFeature mtomFeature = getMTOMFeature();
             if (mtomFeature != null && mtomFeature.isEnabled()) {
                 ((SOAPBinding)jaxwsBinding).setMTOMEnabled(true);
             }
         } else if (getBinding() instanceof XMLBinding) {
-            jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding());
+            jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding(), this);
         } else {
             //REVISIT: Should not get here, though some bindings like JBI
             //did not implement their own Binding type.
-            jaxwsBinding = new DefaultBindingImpl();
-           
+            jaxwsBinding = new DefaultBindingImpl(this);
+        }
+    }
+
+    public void addHandlerInterceptors() {
+        List<Interceptor<? extends Message>> in = super.getInInterceptors();       
+        List<Interceptor<? extends Message>> out = super.getOutInterceptors();
+        List<Interceptor<? extends Message>> outFault = super.getOutFaultInterceptors();    
+        List<Interceptor<? extends Message>> inFault = super.getInFaultInterceptors(); 
+        
+        in.add(logicalInInterceptor);
+        out.add(logicalOutInterceptor);
+        inFault.add(logicalFaultInInterceptor);
+        outFault.add(logicalFaultOutInterceptor);
+        if (soapHandlerInterceptor != null) {
+            in.add(soapHandlerInterceptor);
+            out.add(soapHandlerInterceptor);
+        }
+        if (soapFaultInInterceptor != null) {
+            inFault.add(soapFaultInInterceptor);
+        }
+        if (soapFaultOutInterceptor != null) {
+            outFault.add(soapFaultOutInterceptor);
+        }
+    }
+    public void removeHandlerInterceptors() {
+        List<Interceptor<? extends Message>> in = super.getInInterceptors();       
+        List<Interceptor<? extends Message>> out = super.getOutInterceptors();
+        List<Interceptor<? extends Message>> outFault = super.getOutFaultInterceptors();    
+        List<Interceptor<? extends Message>> inFault = super.getInFaultInterceptors(); 
+        
+        in.remove(logicalInInterceptor);
+        out.remove(logicalOutInterceptor);
+        inFault.remove(logicalFaultInInterceptor);
+        outFault.remove(logicalFaultOutInterceptor);
+        if (soapHandlerInterceptor != null) {
+            in.remove(soapHandlerInterceptor);
+            out.remove(soapHandlerInterceptor);
+        }
+        if (soapFaultInInterceptor != null) {
+            inFault.remove(soapFaultInInterceptor);
+        }
+        if (soapFaultOutInterceptor != null) {
+            outFault.remove(soapFaultOutInterceptor);
         }
     }
 }

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java Thu Feb 25 01:22:34 2010
@@ -290,19 +290,19 @@
         assertTrue("Unexpected value for property validating", 
                    Boolean.valueOf((String) ei.getProperties().get(Message.SCHEMA_VALIDATION_ENABLED)));
         List<Interceptor<? extends Message>> interceptors = endpoint.getInInterceptors();
-        assertEquals("Unexpected number of interceptors.", 6, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 4, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-in", 
                      findTestInterceptor(interceptors).getId());
         interceptors = endpoint.getOutInterceptors();
-        assertEquals("Unexpected number of interceptors.", 7, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 5, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-out", 
                      findTestInterceptor(interceptors).getId());
         interceptors = endpoint.getInFaultInterceptors();
-        assertEquals("Unexpected number of interceptors.", 4, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 2, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-in-fault", 
                      findTestInterceptor(interceptors).getId());
         interceptors = endpoint.getOutFaultInterceptors();
-        assertEquals("Unexpected number of interceptors.", 4, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 2, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-out-fault", 
                      findTestInterceptor(interceptors).getId());
         

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java Thu Feb 25 01:22:34 2010
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.jaxws.handler;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.xml.ws.Binding;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.handler.MessageContext;
@@ -51,7 +54,11 @@
         invoker = control.createMock(HandlerChainInvoker.class);
         message = control.createMock(IIOPMessage.class);
         exchange = control.createMock(Exchange.class);
+        binding = control.createMock(Binding.class);
         
+        List<Handler> list = new ArrayList<Handler>();
+        list.add(null);
+        expect(binding.getHandlerChain()).andReturn(list).anyTimes();
     }
     
     @After

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java Thu Feb 25 01:22:34 2010
@@ -252,6 +252,10 @@
     
     @Test
     public void testHandleMessageThrowsProtocolExceptionOutbound() {
+        message = new SoapMessage(message);
+        lmc = new LogicalMessageContextImpl(message);
+        pmc = new WrappedMessageContext(message);      
+
         ProtocolException pe = new ProtocolException("banzai");
         protocolHandlers[2].setException(pe);
         
@@ -265,7 +269,7 @@
         
         //create an empty SOAP body for testing
         try {
-            pmc = new SOAPMessageContextImpl(new SoapMessage(message));
+            pmc = new SOAPMessageContextImpl(message);
             MessageFactory factory = MessageFactory.newInstance();
             SOAPMessage soapMessage = factory.createMessage();      
             ((SOAPMessageContext)pmc).setMessage(soapMessage);            

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java Thu Feb 25 01:22:34 2010
@@ -30,6 +30,7 @@
 import javax.xml.ws.handler.LogicalMessageContext;
 import javax.xml.ws.handler.MessageContext;
 
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.InterceptorChain;
 import org.apache.cxf.jaxws.handler.logical.LogicalHandlerInInterceptor;
 import org.apache.cxf.message.Exchange;
@@ -85,6 +86,8 @@
                 return true;
             }
         });
+        List<Handler> hList = CastUtils.cast(list);
+        expect(binding.getHandlerChain()).andReturn(hList).anyTimes();
         expect(invoker.getLogicalHandlers()).andReturn(list);
         expect(message.getExchange()).andReturn(exchange).anyTimes();
         expect(message.get(Message.REQUESTOR_ROLE)).andReturn(Boolean.TRUE).anyTimes();
@@ -127,6 +130,8 @@
 
         IMocksControl control1 = createNiceControl();
         Binding binding1 = control1.createMock(Binding.class);
+        List<Handler> hList = CastUtils.cast(list);
+        expect(binding1.getHandlerChain()).andReturn(hList).anyTimes();
         Exchange exchange1 = control1.createMock(Exchange.class);
         expect(exchange1.get(HandlerChainInvoker.class)).andReturn(invoker1).anyTimes();
         Message outMessage = new MessageImpl();

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java Thu Feb 25 01:22:34 2010
@@ -124,6 +124,7 @@
 
         IMocksControl control = createNiceControl();
         Binding binding = control.createMock(Binding.class);
+        expect(binding.getHandlerChain()).andReturn(list).anyTimes();
         Exchange exchange = control.createMock(Exchange.class);
         expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes();
         SoapMessage message = new SoapMessage(new MessageImpl());
@@ -227,6 +228,7 @@
 
         IMocksControl control = createNiceControl();
         Binding binding = control.createMock(Binding.class);
+        expect(binding.getHandlerChain()).andReturn(list).anyTimes();
         Exchange exchange = control.createMock(Exchange.class);
         expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes();
         // This is to set direction to inbound
@@ -326,6 +328,7 @@
 
         IMocksControl control = createNiceControl();
         Binding binding = control.createMock(Binding.class);
+        expect(binding.getHandlerChain()).andReturn(list).anyTimes();
         Exchange exchange = control.createMock(Exchange.class);
         expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes();
         SoapMessage message = new SoapMessage(new MessageImpl());
@@ -410,6 +413,7 @@
         IMocksControl control = createNiceControl();
         Binding binding = control.createMock(Binding.class);
         Exchange exchange = control.createMock(Exchange.class);
+        expect(binding.getHandlerChain()).andReturn(list).anyTimes();
         expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker).anyTimes();
         // This is to set direction to inbound
         expect(exchange.getOutMessage()).andReturn(null);
@@ -461,9 +465,9 @@
 
         IMocksControl control = createNiceControl();
         Binding binding = control.createMock(Binding.class);
+        expect(binding.getHandlerChain()).andReturn(list).anyTimes();
         SoapMessage message = control.createMock(SoapMessage.class);
         Exchange exchange = control.createMock(Exchange.class);
-        expect(binding.getHandlerChain()).andReturn(list);
         expect(message.getExchange()).andReturn(exchange).anyTimes();
         expect(message.keySet()).andReturn(new HashSet<String>());
         expect(exchange.get(HandlerChainInvoker.class)).andReturn(invoker);

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java (original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java Thu Feb 25 01:22:34 2010
@@ -31,7 +31,6 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
-import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.configuration.security.CertificateConstraintsType;
@@ -41,6 +40,7 @@
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.http.AbstractHTTPDestination;
@@ -162,7 +162,8 @@
         try {
             url = new URL(endpointInfo.getAddress());
         } catch (Exception e) {
-            throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage()), e);
+            throw new Fault(new org.apache.cxf.common.i18n.Message("START_UP_SERVER_FAILED_MSG",
+                                                                   LOG, e.getMessage()), e);
         }
         engine.addServant(url, 
                           new JettyHTTPHandler(this, contextMatchOnExact()));
@@ -289,7 +290,7 @@
         if (LOG.isLoggable(Level.FINE)) {
             LOG.fine("Service http request on thread: " + Thread.currentThread());
         }
-        MessageImpl inMessage = retrieveFromContinuation(req);
+        Message inMessage = retrieveFromContinuation(req);
         
         if (inMessage == null) {
             
@@ -301,7 +302,7 @@
             
             setupMessage(inMessage, context, req, resp);
             
-            inMessage.setDestination(this);
+            ((MessageImpl)inMessage).setDestination(this);
     
             ExchangeImpl exchange = new ExchangeImpl();
             exchange.setInMessage(inMessage);
@@ -339,8 +340,8 @@
         }
     }
 
-    protected MessageImpl retrieveFromContinuation(HttpServletRequest req) {
-        MessageImpl m = null;
+    protected Message retrieveFromContinuation(HttpServletRequest req) {
+        Message m = null;
         
         if (!engine.getContinuationsEnabled()) {
             return null;
@@ -351,7 +352,7 @@
             Object o = cont.getObject();
             if (o instanceof ContinuationInfo) {
                 ContinuationInfo ci = (ContinuationInfo)o;
-                m = (MessageImpl)ci.getMessage();
+                m = ci.getMessage();
                 
                 // now that we got the message we don't need ContinuationInfo
                 // as we don't know how continuation was suspended, by jetty wrapper

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java (original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java Thu Feb 25 01:22:34 2010
@@ -70,12 +70,15 @@
     public void setObject(Object userObject) {
         
         ContinuationInfo ci = null;
-        
+        Message m = message;
+        if (m != null && m.getExchange() != null && m.getExchange().getInMessage() != null) {
+            m = m.getExchange().getInMessage();
+        }
         Object obj = continuation.getObject();
         if (obj instanceof ContinuationInfo) {
             ci = (ContinuationInfo)obj;
         } else {
-            ci = new ContinuationInfo(message);
+            ci = new ContinuationInfo(m);
             ci.setUserObject(obj);
         }
         if (message != userObject) {
@@ -108,7 +111,11 @@
     }
 
     protected Message getMessage() {
-        return message;
+        Message m = message;
+        if (m != null && m.getExchange().getInMessage() != null) {
+            m = m.getExchange().getInMessage();
+        }
+        return m;
     }
     
     public org.mortbay.util.ajax.Continuation getContinuation() {

Modified: cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java (original)
+++ cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java Thu Feb 25 01:22:34 2010
@@ -234,7 +234,7 @@
             new TestJettyDestination(transportFactory.getBus(), 
                                      transportFactory, ei);
         testDestination.finalizeConfig();
-        MessageImpl mi = testDestination.retrieveFromContinuation(httpRequest);
+        Message mi = testDestination.retrieveFromContinuation(httpRequest);
         assertSame("Message is lost", m, mi);
         EasyMock.verify(continuation);
         EasyMock.reset(httpRequest);
@@ -276,7 +276,7 @@
             new TestJettyDestination(transportFactory.getBus(), 
                                      transportFactory, ei);
         testDestination.finalizeConfig();
-        MessageImpl mi = testDestination.retrieveFromContinuation(httpRequest);
+        Message mi = testDestination.retrieveFromContinuation(httpRequest);
         assertNull("Continuations must be ignored", mi);
     }
     
@@ -1006,7 +1006,7 @@
         }
         
         @Override
-        public MessageImpl retrieveFromContinuation(HttpServletRequest request) {
+        public Message retrieveFromContinuation(HttpServletRequest request) {
             return super.retrieveFromContinuation(request);
         }
         

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java Thu Feb 25 01:22:34 2010
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.transport.http;
 
-import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
@@ -149,12 +148,8 @@
         HttpURLConnectionFactory fac = null;
         boolean useHttps = false;
 
-        try {
-            if (address == null) {
-                address = configuredConduit.getAddress();
-            }
-        } catch (MalformedURLException e) {
-            //ignore, just use info based on Tls
+        if (address == null) {
+            address = configuredConduit.getAddress();
         }
         if (address != null 
             && address.startsWith(HttpsURLConnectionFactory.HTTPS_URL_PROTOCOL_ID + ":/")) {

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Thu Feb 25 01:22:34 2010
@@ -205,6 +205,7 @@
      * is created on demand.
      */
     private URL defaultEndpointURL;
+    private String defaultEndpointURLString;
     private boolean fromEndpointReferenceType;
 
     // Configurable values
@@ -420,7 +421,7 @@
 
         // Get the correct URLConnection factory based on the 
         // configuration.
-        retrieveConnectionFactory();
+        connectionFactory = retrieveConnectionFactory(getAddress());
 
         // We have finalized the configuration. Any configurable entity
         // set now, must make changes dynamically.
@@ -453,18 +454,15 @@
      * UnitTest that will of course break, should the calls to the URL Connection
      * Factory get altered.
      */
-    protected synchronized void retrieveConnectionFactory() {
-        connectionFactory = AbstractHTTPTransportFactory.getConnectionFactory(this);
-    }
-    protected synchronized void retrieveConnectionFactory(String url) {
-        connectionFactory = AbstractHTTPTransportFactory.getConnectionFactory(this, url);
+    protected synchronized HttpURLConnectionFactory retrieveConnectionFactory(String url) {
+        return AbstractHTTPTransportFactory.getConnectionFactory(this, url);
     }
     
     
     protected synchronized HttpURLConnectionFactory getConnectionFactory(URL url) {
         if (connectionFactory == null 
             || !url.getProtocol().equals(connectionFactory.getProtocol())) {
-            retrieveConnectionFactory(url.toString());
+            connectionFactory = retrieveConnectionFactory(url.toString());
         }
 
         return connectionFactory;
@@ -497,16 +495,15 @@
         // protocol from the default set in EndpointInfo that is associated
         // with the Conduit.
         URL currentURL = setupURL(message);       
-        
+
         // The need to cache the request is off by default
         boolean needToCacheRequest = false;
         
         HTTPClientPolicy csPolicy = getClient(message);
-        HttpURLConnection connection = getConnectionFactory(currentURL)
-            .createConnection(getProxy(csPolicy), currentURL);
+
+        HttpURLConnectionFactory f = getConnectionFactory(currentURL);
+        HttpURLConnection connection = f.createConnection(getProxy(csPolicy), currentURL);
         connection.setDoOutput(true);  
-        
-        //TODO using Message context to decided HTTP send properties 
              
         long timeout = csPolicy.getConnectionTimeout();
         if (timeout > Integer.MAX_VALUE) {
@@ -533,7 +530,7 @@
         } else {
             connection.setRequestMethod("POST");
         }
-        
+                
         boolean isChunking = false;
         int chunkThreshold = 0;
         // We must cache the request if we have basic auth supplier
@@ -573,8 +570,7 @@
                 connection.setChunkedStreamingMode(-1);                    
             }
         }
-        
-        
+
         //Do we need to maintain a session?
         maintainSession = Boolean.TRUE.equals((Boolean)message.get(Message.MAINTAIN_SESSION));
         
@@ -614,15 +610,14 @@
         // Set the headers on the message according to configured 
         // client side policy.
         setHeadersByPolicy(message, currentURL, headers);
-     
         
-        message.setContent(OutputStream.class,
-                new WrappedOutputStream(
-                        message, connection,
-                        needToCacheRequest, 
-                        isChunking,
-                        chunkThreshold));
-       
+
+        message.setContent(OutputStream.class, 
+                           new WrappedOutputStream(
+                                   message, connection,
+                                   needToCacheRequest, 
+                                   isChunking,
+                                   chunkThreshold));
         // We are now "ready" to "send" the message. 
     }
     
@@ -662,11 +657,8 @@
      *                     established by the configured MessageTrustDecider.
      * @see MessageTrustDecider
      */
-    private void makeTrustDecision(Message message)
+    private void makeTrustDecision(Message message, HttpURLConnection connection)
         throws IOException {
-
-        HttpURLConnection connection = 
-            (HttpURLConnection) message.get(KEY_HTTP_CONNECTION);
         
         MessageTrustDecider decider2 = message.get(MessageTrustDecider.class);
         if (trustDecider != null || decider2 != null) {
@@ -748,7 +740,7 @@
         if (result == null) {
             if (pathInfo == null && queryString == null) {
                 URL url = getURL();
-                message.put(Message.ENDPOINT_ADDRESS, url.toString());
+                message.put(Message.ENDPOINT_ADDRESS, defaultEndpointURLString);
                 return url;
             }
             result = getURL().toString();
@@ -787,9 +779,9 @@
     /**
      * @return the default target address
      */
-    protected String getAddress() throws MalformedURLException {
+    protected String getAddress() {
         if (defaultEndpointURL != null) {
-            return defaultEndpointURL.toExternalForm();
+            return defaultEndpointURLString;
         } else if (fromEndpointReferenceType) {
             return getTarget().getAddress().getValue();
         }
@@ -799,8 +791,11 @@
     /**
      * @return the default target URL
      */
-    protected synchronized URL getURL() throws MalformedURLException {
-        return getURL(true);
+    protected URL getURL() throws MalformedURLException {
+        if (defaultEndpointURL == null) {
+            return getURL(true);
+        } 
+        return defaultEndpointURL;
     }
 
     /**
@@ -812,12 +807,14 @@
         if (defaultEndpointURL == null && createOnDemand) {
             if (fromEndpointReferenceType && getTarget().getAddress().getValue() != null) {
                 defaultEndpointURL = new URL(this.getTarget().getAddress().getValue());
+                defaultEndpointURLString = defaultEndpointURL.toExternalForm();
                 return defaultEndpointURL;
             }
             if (endpointInfo.getAddress() == null) {
                 throw new MalformedURLException("Invalid address. Endpoint address cannot be null.");
             }
             defaultEndpointURL = new URL(endpointInfo.getAddress());
+            defaultEndpointURLString = defaultEndpointURL.toExternalForm();
         }
         return defaultEndpointURL;
     }
@@ -911,9 +908,9 @@
         HttpURLConnection connection = 
             (HttpURLConnection)message.get(KEY_HTTP_CONNECTION);
 
-        String ct  = (String) message.get(Message.CONTENT_TYPE);
-        String enc = (String) message.get(Message.ENCODING);
-        
+        String ct  = (String)message.get(Message.CONTENT_TYPE);
+        String enc = (String)message.get(Message.ENCODING);
+
         if (null != ct) {
             if (enc != null 
                 && ct.indexOf("charset=") == -1
@@ -1317,7 +1314,7 @@
         // If this is called after the HTTPTransportFactory called 
         // finalizeConfig, we need to update the connection factory.
         if (configFinalized) {
-            retrieveConnectionFactory();
+            connectionFactory = retrieveConnectionFactory(getAddress());
         }
     }
 
@@ -1633,7 +1630,7 @@
         // makeTrustDecision needs to make a connect() call to
         // make sure the proper information is available.
         // 
-        makeTrustDecision(message);
+        makeTrustDecision(message, connection);
 
         // If this is a GET method we must not touch the output
         // stream as this automagically turns the request into a POST.
@@ -1761,7 +1758,7 @@
      * Wrapper output stream responsible for flushing headers and handling
      * the incoming HTTP-level response (not necessarily the MEP response).
      */
-    protected class WrappedOutputStream extends AbstractThresholdOutputStream {
+    public class WrappedOutputStream extends AbstractThresholdOutputStream {
         /**
          * This field contains the currently active connection.
          */
@@ -1785,7 +1782,6 @@
         protected CacheAndWriteOutputStream cachedStream;
 
         protected Message outMessage;
-        
         protected WrappedOutputStream(
                 Message m, 
                 HttpURLConnection c, 
@@ -1835,11 +1831,11 @@
             }
         }
         
-        protected void handleHeadersTrustCaching() throws IOException {
+        public void handleHeadersTrustCaching() throws IOException {
             // Need to set the headers before the trust decision
             // because they are set before the connect().
             setURLRequestHeaders(outMessage);
-            
+           
             //
             // This point is where the trust decision is made because the
             // Sun implementation of URLConnection will not let us 
@@ -1847,7 +1843,7 @@
             // makeTrustDecision needs to make a connect() call to
             // make sure the proper information is available.
             // 
-            makeTrustDecision(outMessage);
+            makeTrustDecision(outMessage, connection);
             
             // Trust is okay, set up for writing the request.
             
@@ -1872,6 +1868,7 @@
             } else {
                 wrappedStream = connection.getOutputStream();
             }
+            
         }
 
         public void flush() throws IOException {
@@ -1893,10 +1890,10 @@
             if (!written) {
                 handleHeadersTrustCaching();
             }
-            super.flush();
             if (!cachingForRetransmission) {
                 super.close();
             } else if (cachedStream != null) {
+                super.flush();
                 cachedStream.getOut().close();
                 cachedStream.closeFlowthroughStream();
             }
@@ -2069,9 +2066,10 @@
             }
         }
         protected void handleResponseInternal() throws IOException {
+            Exchange exchange = outMessage.getExchange();
             int responseCode = connection.getResponseCode();
-            if ((outMessage != null) && (outMessage.getExchange() != null)) {
-                outMessage.getExchange().put(Message.RESPONSE_CODE, responseCode);
+            if (outMessage != null && exchange != null) {
+                exchange.put(Message.RESPONSE_CODE, responseCode);
             }
             
             if (LOG.isLoggable(Level.FINE)) {
@@ -2094,7 +2092,6 @@
                     LOG.fine(buf.toString());
                 }
             }
-        
             
             if (responseCode == HttpURLConnection.HTTP_NOT_FOUND
                 && !MessageUtils.isTrue(outMessage.getContextualProperty(
@@ -2104,7 +2101,6 @@
             }
 
             
-            Exchange exchange = outMessage.getExchange();
 
             InputStream in = null;
             if (isOneway(exchange)) {
@@ -2127,13 +2123,13 @@
             
             Message inMessage = new MessageImpl();
             inMessage.setExchange(exchange);
-            
+            Map<String, List<String>> origHeaders = connection.getHeaderFields();
             Map<String, List<String>> headers = 
                 new HashMap<String, List<String>>();
             for (String key : connection.getHeaderFields().keySet()) {
                 if (key != null) {
                     headers.put(HttpHeaderHelper.getHeaderKey(key), 
-                        connection.getHeaderFields().get(key));
+                        origHeaders.get(key));
                 }
             }
             
@@ -2149,8 +2145,7 @@
                 LOG.log(Level.WARNING, m);
                 throw new IOException(m);   
             } 
-            
-            inMessage.put(Message.ENCODING, normalizedEncoding);
+            inMessage.put(Message.ENCODING, normalizedEncoding);            
                         
             if (maintainSession) {
                 List<String> cookies = connection.getHeaderFields().get("Set-Cookie");
@@ -2163,7 +2158,6 @@
                        : connection.getErrorStream()
                      : in;
             }
-                   
             // if (in == null) : it's perfectly ok for non-soap http services
             // have no response body : those interceptors which do need it will check anyway        
             inMessage.setContent(InputStream.class, in);

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java Thu Feb 25 01:22:34 2010
@@ -77,8 +77,8 @@
         if (pol != null) {
             return intersect(pol, confPolicy);
         }
-        AssertionInfoMap amap =  message.get(AssertionInfoMap.class);
-        if (null == amap) {
+        AssertionInfoMap amap = message.get(AssertionInfoMap.class);
+        if (null == amap || amap.isEmpty()) {
             return confPolicy;
         }
         Collection<AssertionInfo> ais = amap.get(HTTPCLIENTPOLICY_ASSERTION_QNAME);

Modified: cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java (original)
+++ cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java Thu Feb 25 01:22:34 2010
@@ -86,13 +86,12 @@
             connectionFactory = testFactory;
         }
         @Override
-        protected void retrieveConnectionFactory() {
-            // do nothing. i.e do not change the connectionFactory field.
-        }
-        protected void retrieveConnectionFactory(String s) {
+        protected HttpURLConnectionFactory retrieveConnectionFactory(String s) {
             // do nothing. i.e do not change the connectionFactory field.
+            return connectionFactory;
         }
         
+        
     }
     /**
      * @throws java.lang.Exception

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java Thu Feb 25 01:22:34 2010
@@ -179,14 +179,14 @@
         try {
             getLogger().log(Level.FINE, "server received request: ", message);
              // Build CXF message from JMS message
-            MessageImpl inMessage = new MessageImpl();            
+            Message inMessage = new MessageImpl();            
             JMSUtils.populateIncomingContext(message, inMessage, 
                                              JMSConstants.JMS_SERVER_REQUEST_HEADERS, jmsConfig);
             
             JMSUtils.retrieveAndSetPayload(inMessage, message, (String)inMessage.get(Message.ENCODING));
             inMessage.put(JMSConstants.JMS_SERVER_RESPONSE_HEADERS, new JMSMessageHeadersType());
             inMessage.put(JMSConstants.JMS_REQUEST_MESSAGE, message);
-            inMessage.setDestination(this);
+            ((MessageImpl)inMessage).setDestination(this);
             if (jmsConfig.getMaxSuspendedContinuations() != 0) {
                 inMessage.put(ContinuationProvider.class.getName(), 
                               new JMSContinuationProvider(bus,
@@ -211,6 +211,8 @@
             // handle the incoming message
             incomingObserver.onMessage(inMessage);
             
+            inMessage = inMessage.getExchange().getInMessage();
+            
             //need to propagate any exceptions back to Spring container 
             //so transactions can occur
             if (inMessage.getContent(Exception.class) != null && session != null) {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java Thu Feb 25 01:22:34 2010
@@ -53,14 +53,18 @@
     }
     
     public Continuation getContinuation() {
-        if (inMessage.getExchange().isOneWay()) {
+        Message m = inMessage;
+        if (m != null && m.getExchange() != null && m.getExchange().getInMessage() != null) {
+            m = m.getExchange().getInMessage();
+        }
+        if (m.getExchange().isOneWay()) {
             return null;
         }
-        JMSContinuation cw = inMessage.get(JMSContinuation.class);
+        JMSContinuation cw = m.get(JMSContinuation.class);
         if (cw == null) {
-            cw = new JMSContinuation(bus, inMessage,  incomingObserver, continuations, 
+            cw = new JMSContinuation(bus, m,  incomingObserver, continuations, 
                                      jmsListener, jmsConfig);
-            inMessage.put(JMSContinuation.class, cw);
+            m.put(JMSContinuation.class, cw);
         }
         return cw;
         

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Thu Feb 25 01:22:34 2010
@@ -421,8 +421,8 @@
                                 // ensure decoupled back channel input stream is closed
                                 c.setMessageObserver(new MessageObserver() {
                                     public void onMessage(Message m) {
-                                        if (m.getContentFormats().contains(InputStream.class)) {
-                                            InputStream is = m.getContent(InputStream.class);
+                                        InputStream is = m.getContent(InputStream.class);
+                                        if (is != null) {
                                             try {
                                                 is.close();
                                             } catch (Exception e) {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java Thu Feb 25 01:22:34 2010
@@ -146,6 +146,8 @@
                         }
                         message.getExchange().get(Endpoint.class).put(SecurityConstants.TOKEN_ID, 
                                                                       tok.getId());
+                        message.getExchange().put(SecurityConstants.TOKEN_ID, 
+                                                  tok.getId());
                         getTokenStore(message).add(tok);
                     }
                 } else {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java Thu Feb 25 01:22:34 2010
@@ -233,6 +233,7 @@
                                                   policy,
                                                   null);
             endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store);
+            message.getExchange().put(TokenStore.class.getName(), store);
         
             EndpointPolicy ep = pe.getServerEndpointPolicy(endpoint.getEndpointInfo(), destination);
             List<Interceptor<? extends Message>> interceptors = ep.getInterceptors();

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java Thu Feb 25 01:22:34 2010
@@ -75,6 +75,8 @@
                     }
                     message.getExchange().get(Endpoint.class).put(SecurityConstants.TOKEN_ID, 
                                                                   tok.getId());
+                    message.getExchange().put(SecurityConstants.TOKEN_ID, 
+                                              tok.getId());
                     SecureConversationTokenInterceptorProvider.getTokenStore(message).add(tok);
                     
                 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java Thu Feb 25 01:22:34 2010
@@ -107,6 +107,7 @@
             tokenStore = new MemoryTokenStore();
             message.getExchange().get(Endpoint.class).getEndpointInfo()
                 .setProperty(TokenStore.class.getName(), tokenStore);
+            message.getExchange().put(TokenStore.class.getName(), tokenStore);
         }
         return tokenStore;
     }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java Thu Feb 25 01:22:34 2010
@@ -574,6 +574,7 @@
         ptoken.setToken(sct);
         
         SignedEncryptedParts parts = new SignedEncryptedParts(true);
+        parts.setOptional(true);
         parts.setBody(true);
         parts.addHeader(new Header("To", addressingNamespace));
         parts.addHeader(new Header("From", addressingNamespace));

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java Thu Feb 25 01:22:34 2010
@@ -332,6 +332,9 @@
         synchronized (info) {
             TokenStore tokenStore = (TokenStore)message.getContextualProperty(TokenStore.class.getName());
             if (tokenStore == null) {
+                tokenStore = (TokenStore)info.getProperty(TokenStore.class.getName());
+            }
+            if (tokenStore == null) {
                 tokenStore = new MemoryTokenStore();
                 info.setProperty(TokenStore.class.getName(), tokenStore);
             }

Modified: cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java (original)
+++ cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java Thu Feb 25 01:22:34 2010
@@ -23,6 +23,8 @@
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.service.Service;
@@ -48,7 +50,9 @@
         Service service = server.getEndpoint().getService();
         
         service.getInInterceptors().add(new SAAJInInterceptor());
+        service.getInInterceptors().add(new LoggingInInterceptor());
         service.getOutInterceptors().add(new SAAJOutInterceptor());
+        service.getOutInterceptors().add(new LoggingOutInterceptor());
 
         wsIn = new WSS4JInInterceptor();
         wsIn.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/insecurity.properties");
@@ -74,8 +78,10 @@
         echo = (Echo)proxyFac.create();
 
         client = ClientProxy.getClient(echo);
+        client.getInInterceptors().add(new LoggingInInterceptor());
         client.getInInterceptors().add(wsIn);
         client.getInInterceptors().add(new SAAJInInterceptor());
+        client.getOutInterceptors().add(new LoggingOutInterceptor());
         client.getOutInterceptors().add(wsOut);
         client.getOutInterceptors().add(new SAAJOutInterceptor());
     }

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java (original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java Thu Feb 25 01:22:34 2010
@@ -207,8 +207,7 @@
         Dispatch<DOMSource> disp = service.createDispatch(portNameXML, DOMSource.class, Mode.MESSAGE);
 
         TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
-        TestSOAPHandler soapHandler = new TestSOAPHandler();
-        addHandlersProgrammatically(disp, handler, soapHandler);
+        addHandlersProgrammatically(disp, handler);
 
         InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml");
         MessageFactory factory = MessageFactory.newInstance();
@@ -230,8 +229,7 @@
         Dispatch<DOMSource> disp = service.createDispatch(portNameXML, DOMSource.class, Mode.PAYLOAD);
 
         TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
-        TestSOAPHandler soapHandler = new TestSOAPHandler();
-        addHandlersProgrammatically(disp, handler, soapHandler);
+        addHandlersProgrammatically(disp, handler);
 
         InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml");
         MessageFactory factory = MessageFactory.newInstance();
@@ -253,8 +251,7 @@
         Dispatch<DataSource> disp = service.createDispatch(portNameXML, DataSource.class, Mode.MESSAGE);
 
         TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
-        TestSOAPHandler soapHandler = new TestSOAPHandler();
-        addHandlersProgrammatically(disp, handler, soapHandler);
+        addHandlersProgrammatically(disp, handler);
 
         URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
         DataSource ds = new URLDataSource(is);
@@ -278,8 +275,7 @@
         Dispatch<DataSource> disp = service.createDispatch(portNameXML, DataSource.class, Mode.PAYLOAD);
 
         TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
-        TestSOAPHandler soapHandler = new TestSOAPHandler();
-        addHandlersProgrammatically(disp, handler, soapHandler);
+        addHandlersProgrammatically(disp, handler);
 
         URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
         DataSource ds = new URLDataSource(is);
@@ -305,8 +301,7 @@
         Dispatch<Object> disp = service.createDispatch(portNameXML, jc, Mode.MESSAGE);
 
         TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
-        TestSOAPHandler soapHandler = new TestSOAPHandler();
-        addHandlersProgrammatically(disp, handler, soapHandler);
+        addHandlersProgrammatically(disp, handler);
 
         org.apache.hello_world_xml_http.wrapped.types.GreetMe req =
             new org.apache.hello_world_xml_http.wrapped.types.GreetMe();
@@ -331,8 +326,7 @@
         Dispatch<Object> disp = service.createDispatch(portNameXML, jc, Mode.PAYLOAD);
 
         TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
-        TestSOAPHandler soapHandler = new TestSOAPHandler();
-        addHandlersProgrammatically(disp, handler, soapHandler);
+        addHandlersProgrammatically(disp, handler);
 
         org.apache.hello_world_xml_http.wrapped.types.GreetMe req =
             new org.apache.hello_world_xml_http.wrapped.types.GreetMe();
@@ -351,6 +345,7 @@
         for (Handler h : handlers) {
             handlerChain.add(h);
         }
+        bp.getBinding().setHandlerChain(handlerChain);
     }
 
     class TestHandler implements LogicalHandler<LogicalMessageContext> {

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java (original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java Thu Feb 25 01:22:34 2010
@@ -1187,6 +1187,7 @@
         for (Handler h : handlers) {
             handlerChain.add(h);
         }
+        bp.getBinding().setHandlerChain(handlerChain);
     }
 
     List<String> getHandlerNames(SOAPBody soapBody) throws Exception {

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java (original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java Thu Feb 25 01:22:34 2010
@@ -168,7 +168,8 @@
         assertNotNull(handlerChain);
         for (Handler h : handlers) {
             handlerChain.add(h);
-        }    
+        }
+        bp.getBinding().setHandlerChain(handlerChain);
     }
 
 }

Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java (original)
+++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java Thu Feb 25 01:22:34 2010
@@ -361,7 +361,8 @@
         // REVISIT: why doesn't the generic (i.e. non-Port-specific)
         // Service.getPort() load the <jaxws:client> configuration?
         greeter = cs.getReplicatedPortA();
-        assertTrue("unexpected conduit slector",
+        assertTrue("unexpected conduit selector: " 
+                   + ClientProxy.getClient(greeter).getConduitSelector().getClass().getName(),
                    ClientProxy.getClient(greeter).getConduitSelector()
                    instanceof FailoverTargetSelector);
     }

Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java (original)
+++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java Thu Feb 25 01:22:34 2010
@@ -193,7 +193,7 @@
         Service service = serviceFactory.create();
         EndpointInfo ei = service.getEndpointInfo(portName);
         JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei);
-        SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding());
+        SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint);
         jaxWsSoapBinding.setMTOMEnabled(enableMTOM);
 
         if (installInterceptors) {

Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java?rev=916080&r1=916079&r2=916080&view=diff
==============================================================================
--- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java (original)
+++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java Thu Feb 25 01:22:34 2010
@@ -126,7 +126,7 @@
         Service service = serviceFactory.create();
         EndpointInfo ei = service.getEndpointInfo(portName);
         JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei);
-        SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding());
+        SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint);
         jaxWsSoapBinding.setMTOMEnabled(enableMTOM);
         
         jaxwsEndpoint.getBinding().getInInterceptors().add(new TestMultipartMessageInterceptor());



Mime
View raw message