axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r383861 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ core/src/org/apache/axis2/addressing/
Date Tue, 07 Mar 2006 12:26:47 GMT
Author: chinthaka
Date: Tue Mar  7 04:26:45 2006
New Revision: 383861

URL: http://svn.apache.org/viewcvs?rev=383861&view=rev
Log:
Fixing addressing meta data handling. Now we can add more than one element as meta data.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/EndpointReference.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java?rev=383861&r1=383860&r2=383861&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
Tue Mar  7 04:26:45 2006
@@ -65,10 +65,13 @@
                     OMElement element = (OMElement) referenceParameters.next();
                     epr.addReferenceParameter(element);
                 }
-            } else
-            if (checkElement(new QName(addressingNamespace, AddressingConstants.Final.WSA_METADATA),
eprChildElement.getQName()))
+            } else if (checkElement(new QName(addressingNamespace, AddressingConstants.Final.WSA_METADATA),
eprChildElement.getQName()))
             {
-                epr.setMetaData(eprChildElement);
+                Iterator referenceParameters = eprChildElement.getChildElements();
+                while (referenceParameters.hasNext()) {
+                    OMElement element = (OMElement) referenceParameters.next();
+                    epr.addMetaData(element);
+                }
             }
         }
     }

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=383861&r1=383860&r2=383861&view=diff
==============================================================================
--- 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
Tue Mar  7 04:26:45 2006
@@ -29,6 +29,7 @@
 import org.apache.ws.commons.om.OMAbstractFactory;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMNamespace;
+import org.apache.ws.commons.om.OMNode;
 import org.apache.ws.commons.soap.SOAPEnvelope;
 import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPFault;
@@ -334,12 +335,15 @@
         }
 
         // add metadata
-        OMElement metaData = epr.getMetaData();
-        if (metaData != null) {
+        ArrayList metaDataList = epr.getMetaData();
+        if (metaDataList != null) {
             OMElement metadata =
                     OMAbstractFactory.getOMFactory().createOMElement(
                             Final.WSA_METADATA,
                             addressingNamespaceObject, soapHeaderBlock);
+            for (int i = 0; i < metaDataList.size(); i++) {
+                  metadata.addChild((OMNode) metaDataList.get(i));
+            }
 
         }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/EndpointReference.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/EndpointReference.java?rev=383861&r1=383860&r2=383861&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/EndpointReference.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/EndpointReference.java
Tue Mar  7 04:26:45 2006
@@ -19,6 +19,7 @@
 
 import org.apache.ws.commons.om.OMAbstractFactory;
 import org.apache.ws.commons.om.OMElement;
+import org.apache.ws.commons.om.OMNode;
 
 import javax.xml.namespace.QName;
 import java.io.Serializable;
@@ -48,13 +49,12 @@
 
     private String name;
     private String address;
-    private OMElement metaData;
+    private ArrayList metaData;
     private Map referenceParameters;
     private ArrayList omElements;
 
 
     /**
-     * 
      * @param address
      */
     public EndpointReference(String address) {
@@ -104,7 +104,6 @@
     }
 
     /**
-     *
      * @param address - xs:anyURI
      */
     public void setAddress(String address) {
@@ -117,18 +116,25 @@
 
     /**
      * {any}
+     *
      * @param omElements
      */
     public void setOmElements(ArrayList omElements) {
         this.omElements = omElements;
     }
 
-    public OMElement getMetaData() {
+    public ArrayList getMetaData() {
         return metaData;
     }
 
-    public void setMetaData(OMElement metaData) {
-        this.metaData = metaData;
+    public void addMetaData(OMNode metaData) {
+        if (metaData != null) {
+            if (this.metaData == null) {
+                this.metaData = new ArrayList();
+            }
+            this.metaData.add(metaData);
+        }
+
     }
 
     public String getName() {
@@ -156,7 +162,16 @@
             OMElement omElement = (OMElement) refParams.next();
             addReferenceParameter(omElement);
         }
-        setMetaData(eprOMElement.getFirstChildWithName(new QName("MetaData")));
+
+        OMElement metaDataElement = eprOMElement.getFirstChildWithName(new QName("MetaData"));
+        if (metaDataElement != null) {
+            Iterator children = metaDataElement.getChildren();
+            while (children.hasNext()) {
+                OMNode omNode = (OMNode) children.next();
+                addMetaData(omNode);
+            }
+        }
+
         setName(eprOMElement.getLocalName());
     }
 



Mime
View raw message