ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r391294 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/EndpointReference.java
Date Tue, 04 Apr 2006 13:07:37 GMT
Author: hemapani
Date: Tue Apr  4 06:07:35 2006
New Revision: 391294

URL: http://svn.apache.org/viewcvs?rev=391294&view=rev
Log:
toOM(...) for EPR, this work only ofr final for now

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

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=391294&r1=391293&r2=391294&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 Apr  4 06:07:35 2006
@@ -20,8 +20,10 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
+import org.apache.axis2.AxisFault;
 
 import javax.xml.namespace.QName;
 import java.io.Serializable;
@@ -228,5 +230,36 @@
     public void toOM() {
         throw new UnsupportedOperationException("Yet to be implemented !!");
     }
+    
+    
+    public OMElement toOM(String nsurl,String localName,String prefix) throws AxisFault{
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        if(prefix!=null){
+            OMNamespace wrapNs = fac.createOMNamespace(nsurl,prefix);
+            OMElement epr = fac.createOMElement(localName,wrapNs);
+            OMNamespace wsans = fac.createOMNamespace(AddressingConstants.Final.WSA_NAMESPACE,AddressingConstants.WSA_DEFAULT_PREFIX);
+            OMElement addressE = fac.createOMElement(AddressingConstants.EPR_ADDRESS,wsans,epr);
+            addressE.setText(address);
+            OMElement metadataE = fac.createOMElement(AddressingConstants.Final.WSA_METADATA,wsans,epr);
+
+            if(this.metaData != null){
+                Iterator metadata = this.metaData.iterator();
+                while(metadata.hasNext()){
+                    metadataE.addChild((OMNode)metadata.next());
+                }
+            }
+
+            if(this.referenceParameters != null){
+                Iterator refParms = referenceParameters.values().iterator();
+                while(refParms.hasNext()){
+                    metadataE.addChild((OMNode)refParms.next());
+                }
+            }
+            return epr;
+        }else{
+        	throw new AxisFault("prefix must ne specified");
+        }
+    }
+
 
 }



Mime
View raw message