axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r497953 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
Date Fri, 19 Jan 2007 20:50:10 GMT
Author: chinthaka
Date: Fri Jan 19 12:50:09 2007
New Revision: 497953

URL: http://svn.apache.org/viewvc?view=rev&rev=497953
Log:
Adding another util method to create an instance of EPR from an XML fragment given as a string.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java?view=diff&rev=497953&r1=497952&r2=497953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
Fri Jan 19 12:50:09 2007
@@ -20,14 +20,17 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.io.ByteArrayInputStream;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 
 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.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.util.AttributeHelper;
 import org.apache.axiom.om.util.ElementHelper;
 import org.apache.axiom.soap.SOAPFactory;
@@ -99,7 +102,24 @@
         //Second pass, identify the properties.
         fromOM(epr, eprOMElement, map, isFinalAddressingNamespace);
     }
-    
+
+    /**
+     * Populates an endpoint reference based on the <code>String</code> that
is
+     * passed in. If the http://schemas.xmlsoap.org/ws/2004/08/addressing namespace
+     * is in effect then any reference properties will be saved as reference parameters.
+     * Regardless of the addressing namespace in effect, any elements present in the
+     * <code>String</code> that are not recognised are saved as extensibility
elements.
+     *
+     * @param eprString string from the element of endpoint reference type
+     * @throws AxisFault if unable to locate an address element
+     */
+    public static EndpointReference fromOM(String eprString) throws AxisFault {
+        try {
+            return fromOM(new StAXOMBuilder(new ByteArrayInputStream(eprString.getBytes())).getDocumentElement());
+        } catch (XMLStreamException e) {
+            throw new AxisFault(e);
+        }
+    }
     /**
      * Populates an endpoint reference based on the <code>OMElement</code> that
is
      * passed in. If the http://schemas.xmlsoap.org/ws/2004/08/addressing namespace



---------------------------------------------------------------------
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