You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2007/04/05 11:02:43 UTC
svn commit: r525768 -
/webservices/axis2/branches/java/1_2/xdocs/@axis2_version_dir@/migration.html
Author: sandakith
Date: Thu Apr 5 02:02:42 2007
New Revision: 525768
URL: http://svn.apache.org/viewvc?view=rev&rev=525768
Log:
resolve AXIS2-2307
Modified:
webservices/axis2/branches/java/1_2/xdocs/@axis2_version_dir@/migration.html
Modified: webservices/axis2/branches/java/1_2/xdocs/@axis2_version_dir@/migration.html
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/xdocs/%40axis2_version_dir%40/migration.html?view=diff&rev=525768&r1=525767&r2=525768
==============================================================================
--- webservices/axis2/branches/java/1_2/xdocs/@axis2_version_dir@/migration.html (original)
+++ webservices/axis2/branches/java/1_2/xdocs/@axis2_version_dir@/migration.html Thu Apr 5 02:02:42 2007
@@ -84,27 +84,38 @@
}</pre>
<p><b>Axis 2</b></p>
-<pre>import ...
+<pre>
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+
+
public class EchoBlockingClient {
- private static EndpointReference targetEPR = new EndpointReference(
- AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyService");
- public static void main(String[] args) {
- try {
- OMElement payload = ClientUtil.getEchoOMElement();
- Options options = new Options();
- ServiceClient client = new ServiceClient();
- options.setTo(targetEPR);
- //Blocking invocation
- OMElement result = client.sendReceive(payload);
- ...
- } catch (AxisFault axisFault) {
- axisFault.printStackTrace();
- } catch (XMLStreamException e) {
- e.printStackTrace();
- }
- }
-}</pre>
+ private static EndpointReference targetEPR = new EndpointReference(
+ "http://127.0.0.1:8080/axis2/services/MyService");
+ public static void main(String[] args) {
+ try {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMNamespace omNs = fac.createOMNamespace("schema namespace", "ns1");
+ OMElement payload = fac.createOMElement("echo", omNs);
+ Options options = new Options();
+ ServiceClient client = new ServiceClient();
+ options.setTo(targetEPR);
+ //Blocking invocation
+ OMElement result = client.sendReceive(payload);
+
+ } catch (AxisFault axisFault) {
+ axisFault.printStackTrace();
+ }
+
+ }
+}
+</pre>
<p>It has been clearly depicted that the invocation in Axis2 is dealt with
the SOAP body element itself. Here the invocation is synchronous, but Axis2
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org