cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r995041 - in /cxf/trunk/rt/ws/addr/src: main/java/org/apache/cxf/ws/addressing/MAPAggregator.java test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
Date Wed, 08 Sep 2010 13:09:42 GMT
Author: sergeyb
Date: Wed Sep  8 13:09:42 2010
New Revision: 995041

URL: http://svn.apache.org/viewvc?rev=995041&view=rev
Log:
[CXF-2981] : retaining original generic ReplyTo EPRs if no alternative EPRs are available

Modified:
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
    cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java?rev=995041&r1=995040&r2=995041&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java Wed
Sep  8 13:09:42 2010
@@ -838,7 +838,7 @@ public class MAPAggregator extends Abstr
             // current invocation
             EndpointReferenceType replyTo = maps.getReplyTo();
             if (ContextUtils.isGenericAddress(replyTo)) {
-                replyTo = getReplyTo(message);
+                replyTo = getReplyTo(message, replyTo);
                 if (replyTo == null
                     || (isOneway
                         && (replyTo.getAddress() == null
@@ -895,11 +895,12 @@ public class MAPAggregator extends Abstr
         }
     }
 
-    private EndpointReferenceType getReplyTo(Message message) {
+    private EndpointReferenceType getReplyTo(Message message, 
+                                             EndpointReferenceType originalReplyTo) {
         Exchange exchange = message.getExchange();
         Endpoint info = exchange.get(Endpoint.class);
         if (info == null) {
-            return null;
+            return originalReplyTo;
         }
         synchronized (info) {
             EndpointInfo ei = info.getEndpointInfo();
@@ -914,7 +915,7 @@ public class MAPAggregator extends Abstr
                 return dest.getAddress();
             }
         }
-        return null;
+        return originalReplyTo;
     }
 
     private Destination createDecoupledDestination(Message message) {

Modified: cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java?rev=995041&r1=995040&r2=995041&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
(original)
+++ cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/MAPAggregatorTest.java
Wed Sep  8 13:09:42 2010
@@ -348,6 +348,32 @@ public class MAPAggregatorTest extends A
             // expected
         }
     }
+    
+    @Test
+    public void testReplyToWithAnonymousAddressRetained() throws Exception {
+        Message message = new MessageImpl();  
+        Exchange exchange = new ExchangeImpl();
+        message.setExchange(exchange);
+        exchange.setOutMessage(message);
+        setUpMessageProperty(message,
+                             REQUESTOR_ROLE,
+                             Boolean.TRUE);
+        AddressingPropertiesImpl maps = new AddressingPropertiesImpl();
+        EndpointReferenceType replyTo = new EndpointReferenceType();
+        replyTo.setAddress(ContextUtils.getAttributedURI(Names.WSA_ANONYMOUS_ADDRESS));
+        maps.setReplyTo(replyTo);
+        AttributedURIType id = 
+            ContextUtils.getAttributedURI("urn:uuid:12345");
+        maps.setMessageID(id);
+        maps.setAction(ContextUtils.getAttributedURI(""));
+        setUpMessageProperty(message,
+                             CLIENT_ADDRESSING_PROPERTIES,
+                             maps);
+        aggregator.mediate(message, false);
+        AddressingProperties props = 
+            (AddressingProperties)message.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        assertSame(replyTo, props.getReplyTo());
+    }
 
     
     private Message setUpMessage(boolean requestor, 



Mime
View raw message