cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1185023 - in /cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing: ContextUtils.java soap/MAPCodec.java
Date Mon, 17 Oct 2011 06:50:32 GMT
Author: ema
Date: Mon Oct 17 06:50:32 2011
New Revision: 1185023

URL: http://svn.apache.org/viewvc?rev=1185023&view=rev
Log:
[CXF-3840]:Fix WS-Addressing and WS-RM: Nested Reference Parameters in request are not supported
and become concatenated in the response to client

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

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=1185023&r1=1185022&r2=1185023&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 Mon
Oct 17 06:50:32 2011
@@ -30,7 +30,6 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 
@@ -925,7 +924,7 @@ public final class ContextUtils {
         return NONE_ENDPOINT_REFERENCE;
     }
 
-    public static void applyReferenceParam(EndpointReferenceType toEpr, JAXBElement<String>
el) {
+    public static void applyReferenceParam(EndpointReferenceType toEpr, Object el) {
         if (null == toEpr.getReferenceParameters()) {
             toEpr.setReferenceParameters(WSA_OBJECT_FACTORY.createReferenceParametersType());
         }

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=1185023&r1=1185022&r2=1185023&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 Mon
Oct 17 06:50:32 2011
@@ -365,15 +365,13 @@ public class MAPCodec extends AbstractSo
                         JAXBElement jaxbEl = null;
                         if (o instanceof Element) {
                             Element e = (Element)o;
-                            QName elQn = new QName(e.getNamespaceURI(), e.getLocalName());
-                            jaxbEl = new JAXBElement<String>(elQn,
-                                String.class, 
-                                e.getTextContent());
+                            Node importedNode = header.getOwnerDocument().importNode(e, true);
+                            header.appendChild(importedNode);                           

                         } else {
                             jaxbEl = (JAXBElement) o;
+                            marshaller.marshal(jaxbEl, header);
                         }
-                        marshaller.marshal(jaxbEl, header);
-                        
+                                               
                         Element lastAdded = (Element)header.getLastChild();
                         addIsReferenceParameterMarkerAttribute(lastAdded, maps.getNamespaceURI());
                     } else {
@@ -615,8 +613,12 @@ public class MAPCodec extends AbstractSo
         EndpointReferenceType toEpr = maps.getToEndpointReference();
         if (null != toEpr) {
             for (Element e : referenceParameterHeaders) {
-                JAXBElement<String> el = unmarshaller.unmarshal(e, String.class);
-                ContextUtils.applyReferenceParam(toEpr, el);
+                if (DOMUtils.getChild(e, Node.ELEMENT_NODE) == null) {
+                    JAXBElement<String> el = unmarshaller.unmarshal(e, String.class);
+                    ContextUtils.applyReferenceParam(toEpr, el);
+                } else {
+                    ContextUtils.applyReferenceParam(toEpr, e);
+                }
             }
         }
     }



Mime
View raw message