You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2005/12/02 04:55:44 UTC

svn commit: r351569 - in /webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft: MicrosoftAsyncEchoClient.java MicrosoftAsyncPingClient.java MicrosoftSyncPingClient.java

Author: chamikara
Date: Thu Dec  1 19:55:24 2005
New Revision: 351569

URL: http://svn.apache.org/viewcvs?rev=351569&view=rev
Log:
Some changes due to recent modifications to Axis2

Modified:
    webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncEchoClient.java
    webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncPingClient.java
    webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftSyncPingClient.java

Modified: webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncEchoClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncEchoClient.java?rev=351569&r1=351568&r2=351569&view=diff
==============================================================================
--- webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncEchoClient.java (original)
+++ webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncEchoClient.java Thu Dec  1 19:55:24 2005
@@ -21,7 +21,7 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Call;
-import org.apache.axis2.client.MessageSender;
+import org.apache.axis2.client.Options;
 import org.apache.axis2.client.async.AsyncResult;
 import org.apache.axis2.client.async.Callback;
 import org.apache.axis2.context.MessageContextConstants;
@@ -29,8 +29,7 @@
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
 import org.apache.axis2.om.OMNamespace;
-import org.apache.axis2.soap.SOAP12Constants;
-import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.Sandesha2Constants.ClientAPI;
 import org.apache.sandesha2.util.SandeshaUtil;
 
 public class MicrosoftAsyncEchoClient {
@@ -50,24 +49,18 @@
 	
 	private void run () throws AxisFault {
 		Call call = new Call(AXIS2_CLIENT_PATH);
-		call.engageModule(new QName("sandesha"));
-		call.set(Constants.AcksTo,"http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString"); //Optional
-		
-		call.setTo(new EndpointReference(to));
-		call.set(MessageContextConstants.TRANSPORT_URL,transportTo);
-		call.set(Constants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Optional
-		call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		call.setTransportInfo(org.apache.axis2.Constants.TRANSPORT_HTTP,org.apache.axis2.Constants.TRANSPORT_HTTP,true);
-		//call.set(Constants.SANDESHA_DEBUG_MODE,"on");
-		call.setWsaAction("urn:wsrm:EchoString");
-		call.setSoapAction("urn:wsrm:EchoString");
+		Options clientOptions = new Options ();
+		call.setClientOptions(clientOptions);
 		
-//		Callback callback1 = new TestCallback ("Callback 1");
-//		call.invokeNonBlocking("echoString", getEchoOMBlock("echo1"),callback1);
-//		Callback callback2 = new TestCallback ("Callback 2");
-//		call.invokeNonBlocking("echoString", getEchoOMBlock("echo2"),callback2);
+		call.engageModule(new QName("sandesha"));
+		clientOptions.setProperty(ClientAPI.AcksTo,"http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString"); //Optional
 		
-		call.set(Constants.LAST_MESSAGE, "true");
+		clientOptions.setTo(new EndpointReference(to));
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
+		clientOptions.setProperty(ClientAPI.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Optional
+		clientOptions.setAction("urn:wsrm:EchoString");
+		clientOptions.setSoapAction("urn:wsrm:EchoString");
+		clientOptions.setProperty(ClientAPI.LAST_MESSAGE, "true");
 		Callback callback3 = new TestCallback ("Callback 3");
 		call.invokeNonBlocking("echoString", getEchoOMBlock("echo3"),callback3);
 	}

Modified: webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncPingClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncPingClient.java?rev=351569&r1=351568&r2=351569&view=diff
==============================================================================
--- webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncPingClient.java (original)
+++ webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftAsyncPingClient.java Thu Dec  1 19:55:24 2005
@@ -21,13 +21,13 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.MessageSender;
+import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContextConstants;
 import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
 import org.apache.axis2.om.OMNamespace;
-import org.apache.axis2.soap.SOAP12Constants;
-import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.Sandesha2Constants.ClientAPI;
 
 /**
  * @author chamikara
@@ -58,21 +58,21 @@
 		}
 		
 		MessageSender sender = new MessageSender (AXIS2_CLIENT_PATH);
+		Options clientOptions = new Options ();
+		sender.setClientOptions(clientOptions);
 		sender.engageModule(new QName ("sandesha"));
-		
-		sender.set(Constants.SANDESHA_DEBUG_MODE,"on");   //Sets the debug on for sandesha.
-		sender.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		sender.setTo(new EndpointReference(to));
-		sender.set(MessageContextConstants.TRANSPORT_URL,transportTo);
-		sender.set(Constants.AcksTo,"http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString");
-		sender.setReplyTo(new EndpointReference ("http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString"));
-		sender.setFaultTo(new EndpointReference ("http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString"));
-		sender.set(Constants.SEQUENCE_KEY,"sequence1");
-		sender.setSoapAction("urn:wsrm:Ping");
-		sender.setWsaAction("urn:wsrm:Ping");
+		clientOptions.setProperty(ClientAPI.SANDESHA_DEBUG_MODE,"on");   //Sets the debug on for sandesha.
+		clientOptions.setTo(new EndpointReference(to));
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
+		clientOptions.setProperty(ClientAPI.AcksTo,"http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString");
+		clientOptions.setReplyTo(new EndpointReference ("http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString"));
+		clientOptions.setFaultTo(new EndpointReference ("http://www-lk.wso2.com:9080/axis2/services/AnonymousService/echoString"));
+		clientOptions.setProperty(ClientAPI.SEQUENCE_KEY,"sequence1");
+		clientOptions.setSoapAction("urn:wsrm:Ping");
+		clientOptions.setAction("urn:wsrm:Ping");
   		sender.send("ping",getPingOMBlock("Microsoft-1"));
 		sender.send("ping",getPingOMBlock("Microsoft-2"));
-		sender.set(Constants.LAST_MESSAGE, "true");
+		clientOptions.setProperty(ClientAPI.LAST_MESSAGE, "true");
 		sender.send("ping",getPingOMBlock("Microsoft-3"));
 	}
 	

Modified: webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftSyncPingClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftSyncPingClient.java?rev=351569&r1=351568&r2=351569&view=diff
==============================================================================
--- webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftSyncPingClient.java (original)
+++ webservices/sandesha/trunk/interop/src/org/apache/sandesha2/interop/microsoft/MicrosoftSyncPingClient.java Thu Dec  1 19:55:24 2005
@@ -21,16 +21,13 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.MessageSender;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContextConstants;
 import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
 import org.apache.axis2.om.OMNamespace;
-import org.apache.axis2.om.impl.llom.OMNamespaceImpl;
-import org.apache.axis2.soap.SOAP12Constants;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.Sandesha2Constants.ClientAPI;
 
 public class MicrosoftSyncPingClient {
 
@@ -54,21 +51,18 @@
 		}
 		
 		MessageSender sender = new MessageSender (AXIS2_CLIENT_PATH);
+		Options clientOptions = new Options ();
+		sender.setClientOptions(clientOptions);
 		sender.engageModule(new QName ("sandesha"));
-		
-		sender.set(Constants.SANDESHA_DEBUG_MODE,"on");   //Sets the debug on for sandesha.
-		
-		sender.setTo(new EndpointReference("http://131.107.72.15/ReliableMessaging_Service_Indigo/ReliableOneWay.svc"));
-		sender.set(MessageContextConstants.TRANSPORT_URL,transportTo);
-		
-		sender.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		sender.set(Constants.SEQUENCE_KEY,"sequence1");
-		sender.setSenderTransport(org.apache.axis2.Constants.TRANSPORT_HTTP);
-		sender.setSoapAction("urn:wsrm:Ping");
-		sender.setWsaAction("urn:wsrm:Ping");
+		clientOptions.setProperty(ClientAPI.SANDESHA_DEBUG_MODE,"on");   //Sets the debug on for sandesha.
+		clientOptions.setTo(new EndpointReference("http://131.107.72.15/ReliableMessaging_Service_Indigo/ReliableOneWay.svc"));
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
+		clientOptions.setProperty(ClientAPI.SEQUENCE_KEY,"sequence1");
+		clientOptions.setSoapAction("urn:wsrm:Ping");
+		clientOptions.setAction("urn:wsrm:Ping");
   		sender.send("ping",getPingOMBlock("Microsoft-1"));
 		sender.send("ping",getPingOMBlock("Microsoft-2"));
-		sender.set(Constants.LAST_MESSAGE, "true");
+		clientOptions.setProperty(ClientAPI.LAST_MESSAGE, "true");
 		sender.send("ping",getPingOMBlock("Microsoft-3"));
 	}
 	



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