cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject [1/4] git commit: [CXF-5602] Create HttpServletRequestSnapshot for requests with WSA ReplyTo prop set
Date Fri, 21 Mar 2014 15:58:48 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.6.x-fixes faf47eff9 -> b55e83c36


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

Branch: refs/heads/2.6.x-fixes
Commit: df7119ae5648a7509a3e3ba59bc37ca84fdd05bc
Parents: faf47ef
Author: Alessio Soldano <asoldano@redhat.com>
Authored: Tue Mar 11 15:55:37 2014 +0100
Committer: Alessio Soldano <asoldano@redhat.com>
Committed: Fri Mar 21 16:25:42 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/df7119ae/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 d0f7524..e4f5107 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
@@ -72,6 +72,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;
@@ -268,8 +270,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
@@ -277,6 +280,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);


Mime
View raw message