Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes ccf4df5f2 -> 3e4d51342


[CXF-5602] Create HttpServletRequestSnapshot for requests with WSA ReplyTo prop 
set


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

Branch: refs/heads/2.7.x-fixes
Commit: 3e4d5134297cc341d93987240708a51e165e5ca1
Parents: ccf4df5
Author: Alessio Soldano <[email protected]>
Authored: Tue Mar 11 15:55:37 2014 +0100
Committer: Alessio Soldano <[email protected]>
Committed: Tue Mar 11 15:59:51 2014 +0100

----------------------------------------------------------------------
 .../cxf/transport/http/AbstractHTTPDestination.java      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/3e4d5134/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
----------------------------------------------------------------------
diff --git 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
index 0c0be97..68b7ae5 100644
--- 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
+++ 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
@@ -74,6 +74,8 @@ import 
org.apache.cxf.transport.http.policy.impl.ServerPolicyCalculator;
 import org.apache.cxf.transport.https.CertConstraints;
 import org.apache.cxf.transport.https.CertConstraintsInterceptor;
 import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.ContextUtils;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl.EndpointReferenceUtils;
 import org.apache.cxf.wsdl.WSDLLibrary;
@@ -274,8 +276,9 @@ public abstract class AbstractHTTPDestination
         final Exchange exchange = inMessage.getExchange();
         DelegatingInputStream in = new 
DelegatingInputStream(req.getInputStream()) {
             public void cacheInput() {
-                if (!cached && exchange.isOneWay()) {
-                    //For one-ways, we need to cache the values of the 
HttpServletRequest
+                if (!cached && (exchange.isOneWay() || 
isWSAddressingReplyToSpecified(exchange))) {
+                    //For one-ways and WS-Addressing invocations with ReplyTo 
address,
+                    //we need to cache the values of the HttpServletRequest
                     //so they can be queried later for things like paths and 
schemes 
                     //and such like that.                   
                     //Please note, exchange used to always get the "current" 
message
@@ -283,6 +286,10 @@ public abstract class AbstractHTTPDestination
                 }
                 super.cacheInput();
             }
+            private boolean isWSAddressingReplyToSpecified(Exchange ex) {
+                AddressingProperties map = 
ContextUtils.retrieveMAPs(ex.getInMessage(), false, false, false);
+                return map != null && 
!ContextUtils.isGenericAddress(map.getReplyTo());
+            }
         };
         
         inMessage.setContent(DelegatingInputStream.class, in);

Reply via email to