cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/5] cxf git commit: [CXF-6506]:Client-side message context value HTTP_REQUEST_HEADERS is not shared between SOAP handlers
Date Mon, 27 Jul 2015 17:17:13 GMT
[CXF-6506]:Client-side message context value HTTP_REQUEST_HEADERS is not shared between SOAP
handlers


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e3f17da0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e3f17da0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e3f17da0

Branch: refs/heads/3.0.x-fixes
Commit: e3f17da00139545a4679435870339053adf9b46c
Parents: 9c863f7
Author: Jim Ma <ema@apache.org>
Authored: Thu Jul 23 11:00:32 2015 +0800
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon Jul 27 13:14:49 2015 -0400

----------------------------------------------------------------------
 .../cxf/jaxws/handler/soap/SOAPMessageContextImpl.java |  2 +-
 .../cxf/systest/handlers/HandlerInvocationTest.java    | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e3f17da0/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
index 6dc8af0..61f3530 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java
@@ -129,7 +129,7 @@ public class SOAPMessageContextImpl extends WrappedMessageContext implements
SOA
                 if (!isRequestor() && isOutbound() && MessageContext.HTTP_RESPONSE_HEADERS.equals(key))
{
                     return null;
                 }
-                if (isRequestor() && isOutbound() && MessageContext.HTTP_REQUEST_HEADERS.equals(key))
{
+                if (isRequestor() && !isOutbound() && MessageContext.HTTP_REQUEST_HEADERS.equals(key))
{
                     return null;
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/e3f17da0/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
b/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
index 5fb4bac..369f052 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
@@ -1134,7 +1134,7 @@ public class HandlerInvocationTest extends AbstractBusClientServerTestBase
{
             assertTrue(e.getMessage().indexOf("HandleMessage throws exception") >= 0);
         }
     }
-
+    
     @Test
     public void testDescription() throws PingException {
         TestHandler<LogicalMessageContext> handler = new TestHandler<LogicalMessageContext>(false)
{
@@ -1224,6 +1224,17 @@ public class HandlerInvocationTest extends AbstractBusClientServerTestBase
{
         }
 
     }
+    
+    @Test
+    public void testHandlerMessgeContext() throws PingException {
+        MessageContextFirstHandler handler1 = new MessageContextFirstHandler();
+        MessageContextSecondHandler handler2 = new MessageContextSecondHandler();
+        addHandlersToChain((BindingProvider)handlerTest, handler1, handler2);
+
+        List<String> resp = handlerTest.ping();
+        assertNotNull(resp);
+        assertNotNull("handler2 can't retrieve header map from message context", handler2.getHeaderMap());
+    }
 
     void addHandlersToChain(BindingProvider bp, Handler<?>... handlers) {
         @SuppressWarnings("rawtypes")


Mime
View raw message