cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1039249 - in /cxf/trunk: rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/ systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/
Date Fri, 26 Nov 2010 05:15:36 GMT
Author: ffang
Date: Fri Nov 26 05:15:36 2010
New Revision: 1039249

URL: http://svn.apache.org/viewvc?rev=1039249&view=rev
Log:
[CXF-3151]Invalid WS-A ReplyTo constant value used by WS-RM--apply patch on behalf of Aki
Yoshida

Modified:
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1039249&r1=1039248&r2=1039249&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Fri
Nov 26 05:15:36 2010
@@ -385,7 +385,9 @@ public final class ContextUtils {
                 exchange.setOutMessage(partialResponse);
                 Conduit backChannel = target.getBackChannel(inMessage,
                                                             partialResponse,
-                                                            reference);
+                                                            reference == null
+                                                            ? ContextUtils.getNoneEndpointReference()
+                                                            : reference);
 
                 if (backChannel != null) {
                     // set up interceptor chains and send message

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java?rev=1039249&r1=1039248&r2=1039249&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java Fri
Nov 26 05:15:36 2010
@@ -244,21 +244,23 @@ public class MAPCodec extends AbstractSo
                                     hdr, 
                                     marshaller);
                 }
-                encodeAsExposed(maps,
-                                message,
-                                maps.getReplyTo(), 
-                                Names.WSA_REPLYTO_QNAME, 
-                                EndpointReferenceType.class,
-                                hdr,
-                                marshaller);
-                if (Names.WSA_REPLYTO_QNAME.equals(duplicate)) {
+                if (needsReplyTo(maps)) {
                     encodeAsExposed(maps,
-                                    message,
-                                    maps.getReplyTo(), 
-                                    Names.WSA_REPLYTO_QNAME, 
-                                    EndpointReferenceType.class,
-                                    hdr,
-                                    marshaller);
+                            message,
+                            maps.getReplyTo(), 
+                            Names.WSA_REPLYTO_QNAME, 
+                            EndpointReferenceType.class,
+                            hdr,
+                            marshaller);
+                    if (Names.WSA_REPLYTO_QNAME.equals(duplicate)) {
+                        encodeAsExposed(maps,
+                                        message,
+                                        maps.getReplyTo(), 
+                                        Names.WSA_REPLYTO_QNAME, 
+                                        EndpointReferenceType.class,
+                                        hdr,
+                                        marshaller);
+                    }
                 }
 
                 encodeAsExposed(maps,
@@ -293,11 +295,7 @@ public class MAPCodec extends AbstractSo
                                     hdr, 
                                     marshaller);
                 }
-                if (maps.getFaultTo() != null
-                    && maps.getFaultTo().getAddress() != null
-                    && maps.getFaultTo().getAddress().getValue() != null
-                    && !maps.getFaultTo().getAddress().getValue()
-                        .equals(maps.getReplyTo().getAddress().getValue())) {
+                if (needsFaultTo(maps)) {
                     encodeAsExposed(maps,
                                     message,
                                     maps.getFaultTo(), 
@@ -337,6 +335,23 @@ public class MAPCodec extends AbstractSo
         }
     }
 
+    private boolean needsReplyTo(AddressingProperties maps) {
+        return maps.getReplyTo() != null 
+            && maps.getReplyTo().getAddress() != null
+            && maps.getReplyTo().getAddress().getValue() != null
+            && !(VersionTransformer.Names200408.WSA_NAMESPACE_NAME.equals(maps.getNamespaceURI())

+                && maps.getReplyTo().getAddress().getValue()
+                .equals(ContextUtils.getNoneEndpointReference().getAddress().getValue()));
+    }
+
+    private boolean needsFaultTo(AddressingProperties maps) {
+        return maps.getFaultTo() != null
+            && maps.getFaultTo().getAddress() != null
+            && maps.getFaultTo().getAddress().getValue() != null
+            && !maps.getFaultTo().getAddress().getValue()
+                .equals(maps.getReplyTo().getAddress().getValue());
+    }
+
     private void encodeReferenceParameters(AddressingProperties maps, Element header, 
                                            Marshaller marshaller) throws JAXBException {
         EndpointReferenceType toEpr = maps.getToEndpointReference();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java?rev=1039249&r1=1039248&r2=1039249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
Fri Nov 26 05:15:36 2010
@@ -129,7 +129,9 @@ public class HeaderVerifier extends Abst
                                       || outgoingPartialResponse;
             verificationCache.put(MAPTest.verifyHeaders(wsaHeaders, 
                                                         partialResponse,
-                                                        isRequestLeg(message)));
+                                                        isRequestLeg(message),
+                                                        !VersionTransformer.Names200408.WSA_NAMESPACE_NAME
+                                                        .equals(currentNamespaceURI)));
         } catch (SOAPException se) {
             verificationCache.put("SOAP header verification failed: " + se);
         }

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java?rev=1039249&r1=1039248&r2=1039249&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java
Fri Nov 26 05:15:36 2010
@@ -372,7 +372,8 @@ public abstract class MAPTestBase extend
      */
     protected static String verifyHeaders(List<String> wsaHeaders,
                                           boolean partial,
-                                          boolean requestLeg) {
+                                          boolean requestLeg,
+                                          boolean replyToRequired) {
         //System.out.println("verifying headers: " + wsaHeaders);
         String ret = null;
         if (!wsaHeaders.contains(Names.WSA_MESSAGEID_NAME)) {
@@ -382,8 +383,9 @@ public abstract class MAPTestBase extend
             ret = "expected To header";
         }
        
-        if (!(wsaHeaders.contains(Names.WSA_REPLYTO_NAME)
-              || wsaHeaders.contains(Names.WSA_RELATESTO_NAME))) {
+        if (replyToRequired 
+            && !(wsaHeaders.contains(Names.WSA_REPLYTO_NAME)
+                || wsaHeaders.contains(Names.WSA_RELATESTO_NAME))) {
             ret = "expected ReplyTo or RelatesTo header";
         }
         /*



Mime
View raw message