cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject git commit: [CXF-5602] Create HttpServletRequestSnapshot for requests with WSA ReplyTo prop set
Date Tue, 11 Mar 2014 14:58:21 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 2131c33de -> 741754e03


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

Branch: refs/heads/master
Commit: 741754e0349e20cff3e87eff788f6d60727714aa
Parents: 2131c33
Author: Alessio Soldano <asoldano@redhat.com>
Authored: Tue Mar 11 15:55:37 2014 +0100
Committer: Alessio Soldano <asoldano@redhat.com>
Committed: Tue Mar 11 15:57:59 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/741754e0/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 c0fc511..9ba391c 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.ws.addressing.EndpointReferenceUtils;
 
@@ -287,8 +289,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
@@ -296,6 +299,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