cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1374361 - in /cxf/trunk: api/src/main/java/org/apache/cxf/ws/addressing/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/
Date Fri, 17 Aug 2012 17:05:13 GMT
Author: dkulp
Date: Fri Aug 17 17:05:12 2012
New Revision: 1374361

URL: http://svn.apache.org/viewvc?rev=1374361&view=rev
Log:
Add support to turn off the sending of the anonymous ReplyTo

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java?rev=1374361&r1=1374360&r2=1374361&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java Fri Aug 17
17:05:12 2012
@@ -32,6 +32,7 @@ import org.apache.cxf.phase.PhaseInterce
  */
 public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
     public static final String USING_ADDRESSING = MAPAggregator.class.getName() + ".usingAddressing";
+    public static final String WRITE_ANONYMOUS_REPLY_TO = MAPAggregator.class.getName() +
".writeAnonymousReplyTo";
     public static final String ADDRESSING_DISABLED = MAPAggregator.class.getName() + ".addressingDisabled";
     public static final String DECOUPLED_DESTINATION = MAPAggregator.class.getName() 
         + ".decoupledDestination";

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=1374361&r1=1374360&r2=1374361&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Fri Aug 17 17:05:12 2012
@@ -107,6 +107,7 @@ import org.apache.cxf.transport.MessageO
 import org.apache.cxf.transport.MultipleEndpointObserver;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.ContextUtils;
+import org.apache.cxf.ws.addressing.MAPAggregator;
 import org.apache.cxf.ws.addressing.WSAddressingFeature;
 import org.apache.cxf.wsdl.WSDLManager;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
@@ -451,7 +452,7 @@ public class SoapBindingFactory extends 
         if (binding.getService() != null) {
             for (EndpointInfo ei: binding.getService().getEndpoints()) {
                 if (ei.getAddress() != null && ei.getAddress().startsWith("soap.udp"))
{
-                    setupUDP(sb);
+                    setupUDP(sb, ei);
                 }
             }
         }
@@ -459,7 +460,7 @@ public class SoapBindingFactory extends 
         return sb;
     }
 
-    protected void setupUDP(InterceptorProvider p) {
+    protected void setupUDP(InterceptorProvider p, EndpointInfo ei) {
         //soap UDP requires ws-addressing turned on
         WSAddressingFeature add = new WSAddressingFeature();
         add.setAddressingRequired(true);
@@ -493,6 +494,8 @@ public class SoapBindingFactory extends 
                 message.put(AbstractOutDatabindingInterceptor.DISABLE_OUTPUTSTREAM_OPTIMIZATION,
Boolean.TRUE);
             }
         });
+        // don't send the ReplyTo headers if we don't need to either
+        ei.setProperty(MAPAggregator.WRITE_ANONYMOUS_REPLY_TO, Boolean.FALSE);
     }
     
     protected void addMessageFromBinding(ExtensibilityElement ext, BindingOperationInfo bop,
@@ -893,7 +896,7 @@ public class SoapBindingFactory extends 
             && d.getAddress().getAddress().getValue() != null 
             && d.getAddress().getAddress().getValue().startsWith("soap.udp")) {
             //soap.udp REQUIRES usage of WS-Addressing... we need to turn this on
-            setupUDP(e);
+            setupUDP(e, e.getEndpointInfo());
         }
         if (mo == null) {
             super.addListener(d, e);

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java?rev=1374361&r1=1374360&r2=1374361&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
(original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
Fri Aug 17 17:05:12 2012
@@ -831,11 +831,11 @@ public class MAPAggregatorImpl extends M
             EndpointReferenceType replyTo = maps.getReplyTo();
             if (ContextUtils.isGenericAddress(replyTo)) {
                 replyTo = getReplyTo(message, replyTo);
-                if (replyTo == null
-                    || (isOneway
-                        && (replyTo.getAddress() == null
-                            || !Names.WSA_NONE_ADDRESS.equals(
-                                    replyTo.getAddress().getValue())))) {
+                if (replyTo == null || (isOneway
+                    && (replyTo == null 
+                        || replyTo.getAddress() == null
+                        || !Names.WSA_NONE_ADDRESS.equals(
+                                replyTo.getAddress().getValue())))) {
                     AttributedURIType address =
                         ContextUtils.getAttributedURI(isOneway
                                                       ? Names.WSA_NONE_ADDRESS
@@ -844,7 +844,12 @@ public class MAPAggregatorImpl extends M
                         ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType();
                     replyTo.setAddress(address);
                 }
-                maps.setReplyTo(replyTo);
+                if (ContextUtils.isGenericAddress(replyTo)
+                    && !MessageUtils.getContextualBoolean(message, WRITE_ANONYMOUS_REPLY_TO,
true)) {
+                    maps.setReplyTo(null);
+                } else {
+                    maps.setReplyTo(replyTo);
+                }
             }
 
             // FaultTo



Mime
View raw message