You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ch...@apache.org on 2006/04/06 13:06:38 UTC

svn commit: r391964 - in /webservices/sandesha/trunk/samples/src/sandesha2/samples/interop: AsyncEchoClient.java AsyncPingClient.java SyncEchoClient.java SyncPingClient.java

Author: chamikara
Date: Thu Apr  6 04:06:35 2006
New Revision: 391964

URL: http://svn.apache.org/viewcvs?rev=391964&view=rev
Log:
Updated samples

Modified:
    webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncEchoClient.java
    webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncPingClient.java
    webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncEchoClient.java
    webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncPingClient.java

Modified: webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncEchoClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncEchoClient.java?rev=391964&r1=391963&r2=391964&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncEchoClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncEchoClient.java Thu Apr  6 04:06:35 2006
@@ -31,7 +31,8 @@
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.MessageContextConstants;
 import org.apache.axis2.description.ClientUtils;
-import org.apache.sandesha2.client.Sandesha2ClientAPI;
+import org.apache.sandesha2.client.RMClientAPI;
+import org.apache.sandesha2.client.RMClientConstants;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
@@ -102,10 +103,10 @@
 		clientOptions.setTo(new EndpointReference (toEPR));
 		
 		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress() + "/" + ServiceClient.ANON_OUT_IN_OP;
-		clientOptions.setProperty(Sandesha2ClientAPI.AcksTo,acksTo);
+		clientOptions.setProperty(RMClientConstants.AcksTo,acksTo);
 		
 		String sequenceKey = "sequence4";
-		clientOptions.setProperty(Sandesha2ClientAPI.SEQUENCE_KEY,sequenceKey);
+		clientOptions.setProperty(RMClientConstants.SEQUENCE_KEY,sequenceKey);
 		
 		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
 		
@@ -113,10 +114,10 @@
 		
 		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
 		
-//		clientOptions.setProperty(Sandesha2ClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
+//		clientOptions.setProperty(RMClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
 		
 		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
-		clientOptions.setProperty(Sandesha2ClientAPI.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		clientOptions.setProperty(RMClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
 		clientOptions.setAction("urn:wsrm:EchoString");
 		
 		//You must set the following two properties in the request-reply case.
@@ -138,7 +139,7 @@
 		Callback callback4 = new TestCallback ("Callback 4");
 		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo4",sequenceKey),callback4);
 
-		clientOptions.setProperty(Sandesha2ClientAPI.LAST_MESSAGE, "true");
+		clientOptions.setProperty(RMClientConstants.LAST_MESSAGE, "true");
 		Callback callback5 = new TestCallback ("Callback 5");
 		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo5",sequenceKey),callback5);
 		

Modified: webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncPingClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncPingClient.java?rev=391964&r1=391963&r2=391964&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncPingClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncPingClient.java Thu Apr  6 04:06:35 2006
@@ -27,8 +27,9 @@
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.sandesha2.client.Sandesha2ClientAPI;
-import org.apache.sandesha2.client.reports.SequenceReport;
+import org.apache.sandesha2.client.RMClientAPI;
+import org.apache.sandesha2.client.RMClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -88,15 +89,15 @@
 		
 //		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
 		
-//		clientOptions.setProperty(Sandesha2ClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
+//		clientOptions.setProperty(RMClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
 		
 		clientOptions.setTo(new EndpointReference (toEPR));
-		clientOptions.setProperty(Sandesha2ClientAPI.AcksTo,acksToEPR);
+		clientOptions.setProperty(RMClientConstants.AcksTo,acksToEPR);
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 		clientOptions.setAction("urn:wsrm:Ping");
 		
 		String sequenceKey = "sequence2";
-		clientOptions.setProperty(Sandesha2ClientAPI.SEQUENCE_KEY,sequenceKey);
+		clientOptions.setProperty(RMClientConstants.SEQUENCE_KEY,sequenceKey);
 		
 		serviceClient.setOptions(clientOptions);
 		serviceClient.engageModule(new QName ("sandesha2"));
@@ -104,12 +105,12 @@
 		serviceClient.fireAndForget(getPingOMBlock("ping1"));
 		serviceClient.fireAndForget(getPingOMBlock("ping2"));
 		
-		clientOptions.setProperty(Sandesha2ClientAPI.LAST_MESSAGE, "true");
+		clientOptions.setProperty(RMClientConstants.LAST_MESSAGE, "true");
 		serviceClient.fireAndForget(getPingOMBlock("ping3"));
 		
 		boolean complete = false;
 		while (!complete) {
-			SequenceReport sequenceReport = Sandesha2ClientAPI.getOutgoingSequenceReport(toEPR,sequenceKey,configContext);
+			SequenceReport sequenceReport = RMClientAPI.getOutgoingSequenceReport(toEPR,sequenceKey,configContext);
 			if (sequenceReport!=null && sequenceReport .getCompletedMessages().size()==3)
 				complete = true;
 			else {

Modified: webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncEchoClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncEchoClient.java?rev=391964&r1=391963&r2=391964&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncEchoClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncEchoClient.java Thu Apr  6 04:06:35 2006
@@ -28,7 +28,8 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.client.Sandesha2ClientAPI;
+import org.apache.sandesha2.client.RMClientAPI;
+import org.apache.sandesha2.client.RMClientConstants;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -85,7 +86,7 @@
 		clientOptions.setTo(new EndpointReference (toEPR));
 		
 		String sequenceKey = "sequence3";
-		clientOptions.setProperty(Sandesha2ClientAPI.SEQUENCE_KEY,sequenceKey);
+		clientOptions.setProperty(RMClientConstants.SEQUENCE_KEY,sequenceKey);
 
 		//You must set the following two properties in the request-reply case.
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
@@ -96,9 +97,9 @@
 		
 //		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
 		
-//		clientOptions.setProperty(Sandesha2ClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
+//		clientOptions.setProperty(RMClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
 		
-//		clientOptions.setProperty(Sandesha2ClientAPI.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+//		clientOptions.setProperty(RMClientAPI.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
 		
 		serviceClient.setOptions(clientOptions);
 		serviceClient.engageModule(new QName ("sandesha2"));  //engaging the sandesha2 module
@@ -108,7 +109,7 @@
 		Callback callback2 = new TestCallback ("Callback 2");
 		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
 		
-		clientOptions.setProperty(Sandesha2ClientAPI.LAST_MESSAGE, "true");
+		clientOptions.setProperty(RMClientConstants.LAST_MESSAGE, "true");
 		Callback callback3 = new TestCallback ("Callback 3");
 		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
 		

Modified: webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncPingClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncPingClient.java?rev=391964&r1=391963&r2=391964&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncPingClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncPingClient.java Thu Apr  6 04:06:35 2006
@@ -28,9 +28,10 @@
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.MessageContextConstants;
 import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.client.RMClientConstants;
 import org.apache.sandesha2.client.RMFaultCallback;
-import org.apache.sandesha2.client.Sandesha2ClientAPI;
-import org.apache.sandesha2.client.reports.SequenceReport;
+import org.apache.sandesha2.client.RMClientAPI;
+import org.apache.sandesha2.client.SequenceReport;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -89,15 +90,15 @@
 		clientOptions.setTo(new EndpointReference (toEPR));
 		
 		String sequenceKey = "sequence1";
-		clientOptions.setProperty(Sandesha2ClientAPI.SEQUENCE_KEY,sequenceKey);
+		clientOptions.setProperty(RMClientConstants.SEQUENCE_KEY,sequenceKey);
 	    
 //		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
 		
 		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
 		
-//		clientOptions.setProperty(Sandesha2ClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
+//		clientOptions.setProperty(RMClientAPI.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.WSRX);  //uncomment this to send the messages according to the WSRX spec.
 		
-		clientOptions.setProperty(Sandesha2ClientAPI.RM_FAULT_CALLBACK, new FaultCallback ());
+		clientOptions.setProperty(RMClientConstants.RM_FAULT_CALLBACK, new FaultCallback ());
 		ServiceClient serviceClient = new ServiceClient (configContext,null);
 		clientOptions.setAction("urn:wsrm:Ping");
 		serviceClient.setOptions(clientOptions);
@@ -107,7 +108,7 @@
 		serviceClient.fireAndForget(getPingOMBlock("ping1"));
 		serviceClient.fireAndForget(getPingOMBlock("ping2"));
 		
-		clientOptions.setProperty(Sandesha2ClientAPI.LAST_MESSAGE, "true");
+		clientOptions.setProperty(RMClientConstants.LAST_MESSAGE, "true");
 
 		serviceClient.fireAndForget(getPingOMBlock("ping3"));
 		
@@ -115,7 +116,7 @@
 		
 		boolean complete = false;
 		while (!complete) {
-			sequenceReport = Sandesha2ClientAPI.getOutgoingSequenceReport(toEPR,sequenceKey,configContext);
+			sequenceReport = RMClientAPI.getOutgoingSequenceReport(toEPR,sequenceKey,configContext);
 			if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
 				complete = true;
 			else {



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