cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject cxf git commit: [CXF-6506]:Client-side message context value HTTP_REQUEST_HEADERS is not shared between SOAP handlers
Date Thu, 23 Jul 2015 03:01:15 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4ac83c790 -> 21779aebd


[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/21779aeb
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/21779aeb
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/21779aeb

Branch: refs/heads/master
Commit: 21779aebde16eb81ae1af5c01928c1e0b73ef7de
Parents: 4ac83c7
Author: Jim Ma <ema@apache.org>
Authored: Thu Jul 23 11:00:32 2015 +0800
Committer: Jim Ma <ema@apache.org>
Committed: Thu Jul 23 11:00:42 2015 +0800

----------------------------------------------------------------------
 .../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/21779aeb/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/21779aeb/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