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 2006/02/26 08:26:57 UTC

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

Author: chamikara
Date: Sat Feb 25 23:26:55 2006
New Revision: 381071

URL: http://svn.apache.org/viewcvs?rev=381071&view=rev
Log:
U can send messages with WSRX namespaces (uncomment the line).

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=381071&r1=381070&r2=381071&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncEchoClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncEchoClient.java Sat Feb 25 23:26:55 2006
@@ -36,6 +36,7 @@
 import org.apache.ws.commons.om.OMFactory;
 import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.soap.SOAP12Constants;
+import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.client.RMReport;
 import org.apache.sandesha2.client.Sandesha2ClientAPI;
 import org.apache.sandesha2.util.SandeshaUtil;
@@ -52,6 +53,7 @@
 	private String transportToPort = "8070";
 	
 	private String toEPR = "http://" + toIP +  ":" + toPort + "/axis2/services/RMInteropService";
+	
 	private String transportToEPR = "http://" + toIP +  ":" + transportToPort + "/axis2/services/RMInteropService";
 	
 	private String acksToEPR = "http://" + ackIP +  ":" + ackPort + "/axis2/services/" + "__ANONYMOUS_SERVICE__";
@@ -96,16 +98,20 @@
 		clientOptions.setProperty(Sandesha2ClientAPI.SEQUENCE_KEY,"sequence1");
 		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
 		
+		//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(Sandesha2ClientAPI.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		
 		//You must set the following two properties in the request-reply case.
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 		clientOptions.setUseSeparateListener(true);
 		
 		serviceClient.setOptions(clientOptions);
-		serviceClient.engageModule(new QName ("sandesha2"));
-		//clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);
-		//clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		String offeredSequenceID = SandeshaUtil.getUUID();
-		clientOptions.setProperty(Sandesha2ClientAPI.OFFERED_SEQUENCE_ID,offeredSequenceID);  //Optional
+		serviceClient.engageModule(new QName ("sandesha2"));  //engaging the sandesha2 module.
 		
 		Callback callback1 = new TestCallback ("Callback 1");
 		serviceClient.sendReceiveNonblocking(getEchoOMBlock("echo1"),callback1);

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=381071&r1=381070&r2=381071&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncPingClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/AsyncPingClient.java Sat Feb 25 23:26:55 2006
@@ -35,6 +35,7 @@
 import org.apache.ws.commons.om.OMFactory;
 import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.soap.SOAP12Constants;
+import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.client.Sandesha2ClientAPI;
 
 
@@ -82,6 +83,12 @@
 		ServiceClient serviceClient = new ServiceClient (configContext,null);
 		
 		Options clientOptions = new Options ();
+		
+		//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(Options.COPY_PROPERTIES,new Boolean (true));
 		clientOptions.setTo(new EndpointReference (toEPR));

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=381071&r1=381070&r2=381071&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncEchoClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncEchoClient.java Sat Feb 25 23:26:55 2006
@@ -37,6 +37,7 @@
 import org.apache.ws.commons.om.OMFactory;
 import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.soap.SOAP12Constants;
+import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.client.Sandesha2ClientAPI;
 import org.apache.sandesha2.util.SandeshaUtil;
 
@@ -78,7 +79,6 @@
 
 		ServiceClient serviceClient = new ServiceClient (configContext,null);
 		
-		
 		Options clientOptions = new Options ();
 		
 		clientOptions.setProperty(Options.COPY_PROPERTIES,new Boolean (true));
@@ -89,11 +89,16 @@
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 		clientOptions.setUseSeparateListener(true);
 		
-		serviceClient.setOptions(clientOptions);
-		serviceClient.engageModule(new QName ("sandesha2"));
+		//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.
 		
-		String offeredSequenceID = SandeshaUtil.getUUID();
-		clientOptions.setProperty(Sandesha2ClientAPI.OFFERED_SEQUENCE_ID,offeredSequenceID);  //Optional
+		//clientOptions.setProperty(Sandesha2ClientAPI.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
 		
 		Callback callback1 = new TestCallback ("Callback 1");
 		serviceClient.sendReceiveNonblocking(getEchoOMBlock("echo1"),callback1);
@@ -107,7 +112,6 @@
         while (!callback3.isComplete()) {
             Thread.sleep(1000);
         }
-
 	}
 
 	private static OMElement getEchoOMBlock(String text) {

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=381071&r1=381070&r2=381071&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncPingClient.java (original)
+++ webservices/sandesha/trunk/samples/src/sandesha2/samples/interop/SyncPingClient.java Sat Feb 25 23:26:55 2006
@@ -42,6 +42,7 @@
 import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.soap.SOAP11Constants;
 import org.apache.ws.commons.soap.SOAP12Constants;
+import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.client.Sandesha2ClientAPI;
 
 
@@ -84,23 +85,24 @@
 		
 		String axis2_xml = AXIS2_CLIENT_PATH + "axis2.xml";
 		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
-		
 		Options clientOptions = new Options ();
 		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
-
 		clientOptions.setProperty(Options.COPY_PROPERTIES, new Boolean (true));
 		clientOptions.setTo(new EndpointReference (toEPR));
 		clientOptions.setProperty(Sandesha2ClientAPI.SEQUENCE_KEY,"sequence1");
-	    //clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);
-		//clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+	    
+		//clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
 		
-		ServiceClient serviceClient = new ServiceClient (configContext,null);
-		//serviceClient.
+		//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.
+		
+		ServiceClient serviceClient = new ServiceClient (configContext,null);		
 		clientOptions.setProperty("prop1","test1234");
 		serviceClient.getAxisService().addParameter (new ParameterImpl  ("prop2","test12345"));
 		
-		serviceClient.engageModule(new QName ("sandesha2"));
+		serviceClient.engageModule(new QName ("sandesha2"));  //engaging the sandesha2 module.
+		
 		serviceClient.setOptions(clientOptions);
 		
 		serviceClient.fireAndForget(getPingOMBlock("ping1"));



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