cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r763272 - in /cxf/trunk/rt/ws/addr/src: main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
Date Wed, 08 Apr 2009 15:10:10 GMT
Author: eglynn
Date: Wed Apr  8 15:10:10 2009
New Revision: 763272

URL: http://svn.apache.org/viewvc?rev=763272&view=rev
Log:
Commited patch for CXF-2161 on behalf of Andrew Dinn. Added unit test coverage also.

Modified:
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
    cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java

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=763272&r1=763271&r2=763272&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 Wed
Apr  8 15:10:10 2009
@@ -211,22 +211,6 @@
                 }
                 encodeAsExposed(maps,
                                 message,
-                                maps.getFrom(), 
-                                Names.WSA_FROM_QNAME,
-                                EndpointReferenceType.class,  
-                                hdr, 
-                                marshaller);
-                if (Names.WSA_FROM_QNAME.equals(duplicate)) {
-                    encodeAsExposed(maps,
-                                    message,
-                                    maps.getFrom(), 
-                                    Names.WSA_FROM_QNAME,
-                                    EndpointReferenceType.class,  
-                                    hdr, 
-                                    marshaller);
-                }
-                encodeAsExposed(maps,
-                                message,
                                 maps.getReplyTo(), 
                                 Names.WSA_REPLYTO_QNAME, 
                                 EndpointReferenceType.class,
@@ -258,6 +242,22 @@
                                     hdr,
                                     marshaller);
                 }
+                encodeAsExposed(maps,
+                                message,
+                                maps.getFrom(), 
+                                Names.WSA_FROM_QNAME,
+                                EndpointReferenceType.class,  
+                                hdr, 
+                                marshaller);
+                if (Names.WSA_FROM_QNAME.equals(duplicate)) {
+                    encodeAsExposed(maps,
+                                    message,
+                                    maps.getFrom(), 
+                                    Names.WSA_FROM_QNAME,
+                                    EndpointReferenceType.class,  
+                                    hdr, 
+                                    marshaller);
+                }
                 if (maps.getFaultTo() != null
                     && maps.getFaultTo().getAddress() != null
                     && maps.getFaultTo().getAddress().getValue() != null
@@ -476,6 +476,12 @@
                                                        headerElement, 
                                                        unmarshaller);
                                 maps.setTo(EndpointReferenceUtils.getEndpointReference(addr));
+                            } else if (Names.WSA_FROM_NAME.equals(localName)) {
+                                maps.setFrom(decodeAsNative(
+                                                       headerURI,
+                                                       EndpointReferenceType.class,
+                                                       headerElement, 
+                                                       unmarshaller));
                             } else if (Names.WSA_REPLYTO_NAME.equals(localName)) {
                                 maps.setReplyTo(decodeAsNative(
                                                        headerURI,

Modified: cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java?rev=763272&r1=763271&r2=763272&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
(original)
+++ cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
Wed Apr  8 15:10:10 2009
@@ -372,6 +372,10 @@
             ? EndpointReferenceType.class : exposedAs200408
                 ? VersionTransformer.Names200408.EPR_TYPE : exposedAs200403
                     ? VersionTransformer.Names200403.EPR_TYPE : null, 5, unmarshaller);
+        setUpHeaderDecode(headers, uri, Names.WSA_FROM_NAME, exposedAsNative
+            ? EndpointReferenceType.class : exposedAs200408
+                ? VersionTransformer.Names200408.EPR_TYPE : exposedAs200403
+                    ? VersionTransformer.Names200403.EPR_TYPE : null, 6, unmarshaller);
     }
 
     private <T> void setUpHeaderDecode(List<Header> headers, String uri, String
name, Class<T> clz,
@@ -417,6 +421,8 @@
             : VersionTransformer.Names200403.WSA_ANONYMOUS_ADDRESS;
         replyTo.setAddress(ContextUtils.getAttributedURI(anonymous));
         maps.setReplyTo(replyTo);
+        EndpointReferenceType from = EndpointReferenceUtils.getEndpointReference("snafu");
+        maps.setFrom(from);
         EndpointReferenceType faultTo = new EndpointReferenceType();
         anonymous = exposeAsNative ? Names.WSA_ANONYMOUS_ADDRESS : exposeAs200408
             ? VersionTransformer.Names200408.WSA_ANONYMOUS_ADDRESS
@@ -443,16 +449,18 @@
             new QName(uri, Names.WSA_TO_NAME),
             new QName(uri, Names.WSA_REPLYTO_NAME),
             new QName(uri, Names.WSA_RELATESTO_NAME),
+            new QName(uri, Names.WSA_FROM_NAME),
             new QName(uri, Names.WSA_FAULTTO_NAME),
         };
         if (exposeAsNative) {
             expectedValues = new Object[] {
-                action, id, to, replyTo, relatesTo, faultTo
+                action, id, to, replyTo, relatesTo, from, faultTo
             };
             expectedDeclaredTypes = new Class<?>[] {
                 AttributedURIType.class, 
-                AttributedURIType.class, AttributedURIType.class, EndpointReferenceType.class,
-                RelatesToType.class, EndpointReferenceType.class,  
+                AttributedURIType.class, AttributedURIType.class, 
+                EndpointReferenceType.class, RelatesToType.class,
+                EndpointReferenceType.class, EndpointReferenceType.class 
             };
         } else if (exposeAs200408) {
             expectedValues = new Object[] {
@@ -461,6 +469,7 @@
                 VersionTransformer.convert(to),
                 VersionTransformer.convert(replyTo),
                 VersionTransformer.convert(relatesTo),
+                VersionTransformer.convert(from),
                 VersionTransformer.convert(faultTo),
             };
             if (!outbound) {
@@ -474,7 +483,8 @@
             expectedDeclaredTypes = new Class<?>[] {
                 AttributedURI.class, AttributedURI.class, AttributedURI.class,
                 VersionTransformer.Names200408.EPR_TYPE, Relationship.class,
-                VersionTransformer.Names200408.EPR_TYPE,
+                VersionTransformer.Names200408.EPR_TYPE, 
+                VersionTransformer.Names200408.EPR_TYPE
             };
         } else if (exposeAs200403) {
             expectedValues = new Object[] {
@@ -483,6 +493,7 @@
                 VersionTransformer.convertTo200403(to),
                 VersionTransformer.convertTo200403(replyTo),
                 VersionTransformer.convertTo200403(relatesTo), 
+                VersionTransformer.convertTo200403(from),
                 VersionTransformer.convertTo200403(faultTo),
             };
             if (!outbound) {
@@ -500,6 +511,7 @@
                 VersionTransformer.Names200403.EPR_TYPE,
                 org.apache.cxf.ws.addressing.v200403.Relationship.class,
                 VersionTransformer.Names200403.EPR_TYPE,
+                VersionTransformer.Names200403.EPR_TYPE
             };
         } else {
             fail("unexpected namespace URI: " + uri);



Mime
View raw message