axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@apache.org
Subject svn commit: r469951 - in /webservices/axis2/trunk/java/modules/addressing: src/org/apache/axis2/addressing/ src/org/apache/axis2/handlers/addressing/ test/org/apache/axis2/addressing/
Date Wed, 01 Nov 2006 16:03:46 GMT
Author: pradine
Date: Wed Nov  1 08:03:45 2006
New Revision: 469951

URL: http://svn.apache.org/viewvc?view=rev&rev=469951
Log:
Ensure that we always use elements from the correct OMFactory.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java?view=diff&rev=469951&r1=469950&r2=469951
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
Wed Nov  1 08:03:45 2006
@@ -27,6 +27,8 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.util.AttributeHelper;
+import org.apache.axiom.om.util.ElementHelper;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.commons.logging.Log;
@@ -184,8 +186,8 @@
             if (metaData != null && AddressingConstants.Final.WSA_NAMESPACE.equals(addressingNamespace))
{
                 OMElement metadataE = factory.createOMElement(AddressingConstants.Final.WSA_METADATA,
wsaNS, eprElement);
                 for (int i = 0, size = metaData.size(); i < size; i++) {
-                    OMNode omNode = (OMNode) metaData.get(i);
-                    metadataE.addChild(omNode);
+                    OMElement omElement = (OMElement) metaData.get(i);
+                    metadataE.addChild(ElementHelper.importOMElement(omElement, factory));
                 }
             }
 
@@ -194,8 +196,8 @@
                 OMElement refParameterElement = factory.createOMElement(AddressingConstants.EPR_REFERENCE_PARAMETERS,
wsaNS, eprElement);
                 Iterator iterator = referenceParameters.values().iterator();
                 while (iterator.hasNext()) {
-                    OMNode omNode = (OMNode) iterator.next();
-                    refParameterElement.addChild(omNode);
+                    OMElement omElement = (OMElement) iterator.next();
+                    refParameterElement.addChild(ElementHelper.importOMElement(omElement,
factory));
                 }
             }
             
@@ -203,7 +205,7 @@
             if (attributes != null) {
                 for (int i = 0, size = attributes.size(); i < size; i++) {
                     OMAttribute omAttribute = (OMAttribute) attributes.get(i);
-                    eprElement.addAttribute(omAttribute);
+                    AttributeHelper.importOMAttribute(omAttribute, eprElement);
                 }
             }
             
@@ -211,8 +213,8 @@
             List extensibleElements = epr.getExtensibleElements();
             if (extensibleElements != null) {
                 for (int i = 0, size = extensibleElements.size(); i < size; i++) {
-                    OMNode omNode = (OMNode) extensibleElements.get(i);
-                    eprElement.addChild(omNode);
+                    OMElement omElement = (OMElement) extensibleElements.get(i);
+                    eprElement.addChild(ElementHelper.importOMElement(omElement, factory));
                 }
             }
         } else {

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?view=diff&rev=469951&r1=469950&r2=469951
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
Wed Nov  1 08:03:45 2006
@@ -178,14 +178,14 @@
                 // Add detail as a wsa:FaultDetail header
                 if (!isAddressingHeaderAlreadyAvailable(Final.FAULT_HEADER_DETAIL, envelope,
addressingNamespaceObject, replaceHeaders)) {
                     SOAPHeaderBlock faultDetail = envelope.getHeader().addHeaderBlock(Final.FAULT_HEADER_DETAIL,
addressingNamespaceObject);
-                    faultDetail.addChild(detailElement);
+                    faultDetail.addChild(ElementHelper.importOMElement(detailElement, envelope.getOMFactory()));
                 }
             }
             else if (!msgContext.isSOAP11()) {
                 // Add detail to the Fault in the SOAP Body
                 SOAPFault fault = envelope.getBody().getFault();
                 if (fault != null && fault.getDetail() != null) {
-                    fault.getDetail().addDetailEntry(detailElement);
+                    fault.getDetail().addDetailEntry(ElementHelper.importOMElement(detailElement,
envelope.getOMFactory()));
                 }
             }
         }

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java?view=diff&rev=469951&r1=469950&r2=469951
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
Wed Nov  1 08:03:45 2006
@@ -25,7 +25,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axis2.context.MessageContext;
 
 import junit.framework.TestCase;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message