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/09/07 12:49:12 UTC

svn commit: r441051 - in /webservices/sandesha/trunk/java/interop: conf/ src/org/ src/sandesha2/ src/sandesha2/interop/ src/sandesha2/interop/rm1_1/ src/sandesha2/interop/rm1_1/clients/ src/sandesha2/interop/service/

Author: chamikara
Date: Thu Sep  7 03:49:11 2006
New Revision: 441051

URL: http://svn.apache.org/viewvc?view=rev&rev=441051
Log:
Changed the package of interop client classes.
Added code/config for a interop service.


Added:
    webservices/sandesha/trunk/java/interop/conf/services.xml
    webservices/sandesha/trunk/java/interop/src/sandesha2/
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_1.java
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_2.java
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_3.java
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_4.java
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_1.java
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_2.java
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_3.java
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/service/
    webservices/sandesha/trunk/java/interop/src/sandesha2/interop/service/RMInteropService.java
Removed:
    webservices/sandesha/trunk/java/interop/src/org/
Modified:
    webservices/sandesha/trunk/java/interop/conf/sandesha2_interop.properties

Modified: webservices/sandesha/trunk/java/interop/conf/sandesha2_interop.properties
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/conf/sandesha2_interop.properties?view=diff&rev=441051&r1=441050&r2=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/conf/sandesha2_interop.properties (original)
+++ webservices/sandesha/trunk/java/interop/conf/sandesha2_interop.properties Thu Sep  7 03:49:11 2006
@@ -1,2 +1,2 @@
-to=http://127.0.0.1:8080/axis2/services/RMSampleService
-transportTo=http://127.0.0.1:8070/axis2/services/RMSampleService
\ No newline at end of file
+to=http://127.0.0.1:8080/axis2/services/RMInteropService
+transportTo=http://127.0.0.1:8070/axis2/services/RMInteropService
\ No newline at end of file

Added: webservices/sandesha/trunk/java/interop/conf/services.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/conf/services.xml?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/conf/services.xml (added)
+++ webservices/sandesha/trunk/java/interop/conf/services.xml Thu Sep  7 03:49:11 2006
@@ -0,0 +1,27 @@
+<service name="RMInteropService">
+   <parameter name="ServiceClass" locked="xsd:false">sandesha2.interop.service.RMInteropService</parameter>
+
+    <description>
+        A simple service used for interops.
+    </description>
+
+    <module ref="sandesha2" />
+       
+    <operation name="ping" mep="http://www.w3.org/2004/08/wsdl/in-only">  
+        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
+    </operation>
+    
+    <operation name="echoString">
+        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
+    </operation>
+       
+    <supported-policy-namespaces namespaces="http://ws.apache.org/sandesha2/policy" />
+
+    <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
+		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+	    xmlns:wsrm="http://ws.apache.org/sandesha2/policy" wsu:Id="RMPolicy">
+	        
+    </wsp:Policy>
+    
+    
+</service>

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_1.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_1.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_1.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_1.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.rm1_1.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+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.axiom.soap.SOAP12Constants;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class Scenario_1_1 {
+
+	private static final String applicationNamespaceName = "http://tempuri.org/"; 
+	private static final String ping = "ping";
+	private static final String Text = "Text";
+	
+	private static String toIP = "127.0.0.1";
+	private static String toPort = "9762";
+	private static String transportToIP = "127.0.0.1";
+	private static String transportToPort = "8070";
+	private static String servicePart = "/axis2/services/RMInteropService";
+	private static String toEPR = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws AxisFault,IOException  {
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+		Properties properties = new Properties();
+		if (in != null) {
+			properties.load(in);
+		}
+		
+		toEPR = properties.getProperty("to");
+		transportToEPR = properties.getProperty("transportTo");
+
+		new Scenario_1_1 ().run();
+	}
+	
+	private void run () throws AxisFault {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory.");
+			return;
+		}
+		
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_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));
+		
+		String sequenceKey = "sequence1";
+		clientOptions.setProperty(SandeshaClientConstants.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(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+		clientOptions.setAction("urn:wsrm:Ping");
+		
+		ServiceClient serviceClient = new ServiceClient (configContext,null);		
+		
+		serviceClient.setOptions(clientOptions);
+		
+		serviceClient.fireAndForget(getPingOMBlock("ping1"));
+		serviceClient.fireAndForget(getPingOMBlock("ping2"));
+		serviceClient.fireAndForget(getPingOMBlock("ping3"));
+		
+		SequenceReport sequenceReport = null;		
+		boolean complete = false;
+		while (!complete) {
+			sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3) 
+				complete = true;
+			else {
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+	    		}
+			}
+		} 		
+		
+		SandeshaClient.terminateSequence(serviceClient);
+		serviceClient.finalizeInvoke();
+	}
+	
+	private static OMElement getPingOMBlock(String text) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace namespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement pingElem = fac.createOMElement(ping, namespace);
+		OMElement textElem = fac.createOMElement(Text, namespace);
+		
+		textElem.setText(text);
+		pingElem.addChild(textElem);
+
+		return pingElem;
+	}
+	
+}

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_2.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_2.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_2.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_2.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.rm1_1.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+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;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class Scenario_1_2 {
+
+	private static final String applicationNamespaceName = "http://tempuri.org/"; 
+	private static final String ping = "ping";
+	private static final String Text = "Text";
+	
+	private static String toIP = "127.0.0.1";
+	private static String toPort = "9762";
+	private static String transportToIP = "127.0.0.1";
+	private static String transportToPort = "8070";
+	private static String servicePart = "/axis2/services/RMInteropService";
+	private static String toEPR = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws AxisFault,IOException {
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+
+		InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+		Properties properties = new Properties();
+		if (in != null) {
+			properties.load(in);
+		}
+		
+		toEPR = properties.getProperty("to");
+		transportToEPR = properties.getProperty("transportTo");
+		
+		new Scenario_1_2 ().run();
+	}
+	
+	private void run () throws AxisFault {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory.");
+			return;
+		}
+		
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_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));
+		
+		String sequenceKey = "sequence1";
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+	    
+//		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
+		
+//		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+
+//		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
+		
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+		clientOptions.setAction("urn:wsrm:Ping");
+		
+		ServiceClient serviceClient = new ServiceClient (configContext,null);		
+		
+		serviceClient.setOptions(clientOptions);
+		
+		clientOptions.setProperty(SandeshaClientConstants.DUMMY_MESSAGE,Sandesha2Constants.VALUE_TRUE);
+		clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
+		serviceClient.fireAndForget(getPingOMBlock("ping31"));
+		
+		clientOptions.setProperty(SandeshaClientConstants.DUMMY_MESSAGE,Sandesha2Constants.VALUE_FALSE);
+
+		SequenceReport sequenceReport = null;
+		
+		boolean established = false;
+		while (!established) {
+			sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getSequenceStatus()>=SequenceReport.SEQUENCE_STATUS_ESTABLISHED) 
+				established = true;
+			else {
+				try {
+					Thread.sleep(100);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+				}
+			} 
+		}
+		
+		SandeshaClient.sendAckRequest(serviceClient);
+		
+		SandeshaClient.terminateSequence(serviceClient);
+		
+		boolean terminated = false;
+		while (!terminated) {
+			sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getSequenceStatus()==SequenceReport.SEQUENCE_STATUS_TERMINATED) 
+				terminated = true;
+			else {
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+				}
+			} 
+		}
+		
+		serviceClient.finalizeInvoke();
+	}
+	
+	private static OMElement getPingOMBlock(String text) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace namespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement pingElem = fac.createOMElement(ping, namespace);
+		OMElement textElem = fac.createOMElement(Text, namespace);
+		
+		textElem.setText(text);
+		pingElem.addChild(textElem);
+
+		return pingElem;
+	}
+	
+}

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_3.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_3.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_3.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_3.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.rm1_1.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+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;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class Scenario_1_3 {
+
+	private static final String applicationNamespaceName = "http://tempuri.org/"; 
+	private static final String ping = "ping";
+	private static final String Text = "Text";
+	
+	private static String toIP = "127.0.0.1";
+	private static String toPort = "9762";
+	private static String transportToIP = "127.0.0.1";
+	private static String transportToPort = "8070";
+	private static String servicePart = "/axis2/services/RMInteropService";
+	private static String toEPR = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws AxisFault,IOException {
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+		Properties properties = new Properties();
+		if (in != null) {
+			properties.load(in);
+		}
+		
+		toEPR = properties.getProperty("to");
+		transportToEPR = properties.getProperty("transportTo");
+		
+		new Scenario_1_3 ().run();
+	}
+	
+	private void run () throws AxisFault {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory.");
+			return;
+		}
+		
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_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));
+		
+		String sequenceKey = "sequence1";
+		clientOptions.setProperty(SandeshaClientConstants.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(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+//		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+
+		clientOptions.setAction("urn:wsrm:Ping");
+		
+		ServiceClient serviceClient = new ServiceClient (configContext,null);		
+
+		serviceClient.setOptions(clientOptions);
+		
+		clientOptions.setProperty(SandeshaClientConstants.MESSAGE_NUMBER,new Long(1));
+		serviceClient.fireAndForget(getPingOMBlock("ping1"));
+		
+		clientOptions.setProperty(SandeshaClientConstants.MESSAGE_NUMBER,new Long(3));
+		serviceClient.fireAndForget(getPingOMBlock("ping3"));
+		
+		boolean complete = false;
+		while (!complete) {
+			SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==2) 
+				complete = true;
+			else {
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+				}
+			} 
+		}
+
+		SandeshaClient.closeSequence(serviceClient);
+		
+		clientOptions.setProperty(SandeshaClientConstants.MESSAGE_NUMBER,new Long(4));
+		serviceClient.fireAndForget(getPingOMBlock("ping4"));	
+
+		SandeshaClient.terminateSequence(serviceClient);		
+		serviceClient.finalizeInvoke();
+	}
+	
+	private static OMElement getPingOMBlock(String text) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace namespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement pingElem = fac.createOMElement(ping, namespace);
+		OMElement textElem = fac.createOMElement(Text, namespace);
+		
+		textElem.setText(text);
+		pingElem.addChild(textElem);
+
+		return pingElem;
+	}
+	
+}

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_4.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_4.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_4.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_1_4.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.rm1_1.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+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.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class Scenario_1_4 {
+
+	private static final String applicationNamespaceName = "http://tempuri.org/";
+
+	private static final String ping = "ping";
+
+	private static final String Text = "Text";
+
+	private static String toIP = "127.0.0.1";
+	private static String toPort = "9762";
+	private static String transportToIP = "127.0.0.1";
+	private static String transportToPort = "8070";
+	private static String servicePart = "/axis2/services/RMInteropService";
+	private static String toEPR = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; // Change
+																											// this
+																											// to
+																											// ur
+																											// path.
+
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator
+			+ "target" + File.separator + "repos" + File.separator + "client"
+			+ File.separator; // this will be available after a maven build
+
+	public static void main(String[] args) throws AxisFault,IOException {
+
+		String axisClientRepo = null;
+		if (args != null && args.length > 0)
+			axisClientRepo = args[0];
+
+		if (axisClientRepo != null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+
+		InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+		Properties properties = new Properties();
+		if (in != null) {
+			properties.load(in);
+		}
+		
+		toEPR = properties.getProperty("to");
+		transportToEPR = properties.getProperty("transportTo");
+		
+		new Scenario_1_4().run();
+	}
+
+	private void run() throws AxisFault {
+
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)) {
+			System.out
+					.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_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.setAction("urn:wsrm:Ping");
+		
+		ServiceClient serviceClient = new ServiceClient(configContext, null);
+		
+		String replyAddress = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress() + "/" + ServiceClient.ANON_OUT_ONLY_OP;
+		
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,replyAddress);
+		clientOptions.setReplyTo(new EndpointReference (replyAddress));
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+		String sequenceKey = "sequence1";
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY, sequenceKey);
+
+		// clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);
+		// //uncomment this to send messages without chunking.
+
+//		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+
+//		 clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+		// //uncomment this to send messages in SOAP 1.2
+
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,
+				Sandesha2Constants.SPEC_VERSIONS.v1_1); // uncomment this to
+														// send the messages
+														// according to the v1_1
+														// spec.
+
+		serviceClient.setOptions(clientOptions);
+
+		serviceClient.fireAndForget(getPingOMBlock("ping1"));
+		serviceClient.fireAndForget(getPingOMBlock("ping2"));
+		serviceClient.fireAndForget(getPingOMBlock("ping3"));
+
+		boolean complete = false;
+		while (!complete) {
+			SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3) 
+				complete = true;
+			else {
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+				}
+			}
+		}
+
+		SandeshaClient.terminateSequence(serviceClient);
+//		serviceClient.finalizeInvoke();
+	}
+
+	private static OMElement getPingOMBlock(String text) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace namespace = fac.createOMNamespace(applicationNamespaceName,
+				"ns1");
+		OMElement pingElem = fac.createOMElement(ping, namespace);
+		OMElement textElem = fac.createOMElement(Text, namespace);
+
+		textElem.setText(text);
+		pingElem.addChild(textElem);
+
+		return pingElem;
+	}
+}

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_1.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_1.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_1.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_1.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,236 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.rm1_1.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+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.axiom.soap.SOAPBody;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class Scenario_2_1 {
+	
+	private final static String applicationNamespaceName = "http://tempuri.org/"; 
+	private final static String echoString = "echoString";
+	private final static String Text = "Text";
+	private final static String Sequence = "Sequence";
+	private final static String echoStringResponse = "echoStringResponse";
+	private final static String EchoStringReturn = "EchoStringReturn";
+	
+	private static String toIP = "127.0.0.1";
+	private static String toPort = "9762";
+	private static String transportToIP = "127.0.0.1";
+	private static String transportToPort = "8070";
+	private static String servicePart = "/axis2/services/RMInteropService";
+	private static String toAddress = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws Exception,IOException {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+		Properties properties = new Properties();
+		if (in != null) {
+			properties.load(in);
+		}
+		
+		toAddress = properties.getProperty("to");
+		transportToEPR = properties.getProperty("transportTo");
+		
+		new Scenario_2_1 ().run();
+	}
+	
+	private void run () throws Exception {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+
+		ServiceClient serviceClient = new ServiceClient (configContext,null);	
+		
+		Options clientOptions = new Options ();
+		
+		clientOptions.setProperty(Options.COPY_PROPERTIES,new Boolean (true));
+		
+		EndpointReference toEPR = new EndpointReference (toAddress);
+		
+		
+		OMFactory factory = OMAbstractFactory.getOMFactory();
+		OMNamespace namespace = factory.createOMNamespace("urn:wsrm:InteropOptions","rmi");
+		OMElement acceptOfferElem = factory.createOMElement("acceptOffer",namespace);
+		OMElement useOfferElem = factory.createOMElement("useOffer",namespace);
+		acceptOfferElem.setText("true");
+		useOfferElem.setText("true");
+		toEPR.addReferenceParameter(acceptOfferElem);
+		toEPR.addReferenceParameter(useOfferElem);
+//		clientOptions.setManageSession(true); // without this reference params wont go.
+		serviceClient.setTargetEPR(toEPR);
+		
+		clientOptions.setTo(toEPR);
+		
+		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+		
+		String sequenceKey = "sequence4";
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
+		
+		clientOptions.setAction("urn:wsrm:EchoString");
+		
+//		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(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+//		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+
+		clientOptions.setProperty(SandeshaClientConstants.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);
+
+		Callback callback1 = new TestCallback ("Callback 1");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
+		
+		Callback callback2 = new TestCallback ("Callback 2");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
+
+		
+		Callback callback3 = new TestCallback ("Callback 3");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
+		
+        while (!callback3.isComplete()) {
+            Thread.sleep(1000);
+        }
+        
+    	SequenceReport sequenceReport = null;		
+		boolean complete = false;
+		while (!complete) {
+			sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3) 
+				complete = true;
+			else {
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+	    		}
+			}
+		} 	
+       
+        SandeshaClient.terminateSequence(serviceClient);
+//        serviceClient.finalizeInvoke();
+        
+	}
+
+	private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+		OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+		OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+		
+		textElem.setText(text);
+		sequenceElem.setText(sequenceKey);
+		echoStringElement.addChild(textElem);
+		echoStringElement.addChild(sequenceElem);
+		
+		return echoStringElement;
+	}
+
+	class TestCallback extends Callback {
+
+		String name = null;
+		
+		public TestCallback (String name) {
+			this.name = name;
+		}
+		
+		public void onComplete(AsyncResult result) {
+			//System.out.println("On Complete Called for " + text);
+			SOAPBody body = result.getResponseEnvelope().getBody();
+			
+			OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+			if (echoStringResponseElem==null) { 
+				System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+				return;
+			}
+			
+			OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+			if (echoStringReturnElem==null) { 
+				System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+				return;
+			}
+			
+			String resultStr = echoStringReturnElem.getText();
+			System.out.println("Callback '" + name +  "' got result:" + resultStr);
+		}
+
+		public void onError (Exception e) {
+			// TODO Auto-generated method stub
+			System.out.println("Error reported for test call back");
+			e.printStackTrace();
+		}
+	}
+
+	
+}

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_2.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_2.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_2.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_2.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.rm1_1.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+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.axiom.soap.SOAPBody;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+
+public class Scenario_2_2 {
+	
+	private final static String applicationNamespaceName = "http://tempuri.org/"; 
+	private final static String echoString = "echoString";
+	private final static String Text = "Text";
+	private final static String Sequence = "Sequence";
+	private final static String echoStringResponse = "echoStringResponse";
+	private final static String EchoStringReturn = "EchoStringReturn";
+	
+	private static String toIP = "127.0.0.1";
+	private static String toPort = "9762";
+	private static String transportToIP = "127.0.0.1";
+	private static String transportToPort = "8070";
+	private static String servicePart = "/axis2/services/RMInteropService";
+	private static String toEPR = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws Exception,IOException {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+		Properties properties = new Properties();
+		if (in != null) {
+			properties.load(in);
+		}
+		
+		toEPR = properties.getProperty("to");
+		transportToEPR = properties.getProperty("transportTo");
+		
+		new Scenario_2_2 ().run();
+	}
+	
+	private void run () throws Exception {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+
+		ServiceClient serviceClient = new ServiceClient (configContext,null);	
+		
+		Options clientOptions = new Options ();
+		
+		clientOptions.setProperty(Options.COPY_PROPERTIES,new Boolean (true));
+		clientOptions.setTo(new EndpointReference (toEPR));
+		
+		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+		
+		String sequenceKey = "sequence4";
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+		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(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+//		clientOptions.setProperty(SandeshaClient.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		
+//		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+
+		clientOptions.setAction("urn:wsrm:EchoString");
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+		clientOptions.setUseSeparateListener(true);
+		
+		serviceClient.setOptions(clientOptions);
+
+		Callback callback1 = new TestCallback ("Callback 1");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
+		
+		Callback callback2 = new TestCallback ("Callback 2");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
+
+		
+		Callback callback3 = new TestCallback ("Callback 3");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
+		
+        while (!callback3.isComplete()) {
+            Thread.sleep(1000);
+        }
+        
+       
+        SandeshaClient.terminateSequence(serviceClient);
+        
+	}
+
+	private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+		OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+		OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+		
+		textElem.setText(text);
+		sequenceElem.setText(sequenceKey);
+		echoStringElement.addChild(textElem);
+		echoStringElement.addChild(sequenceElem);
+		
+		return echoStringElement;
+	}
+
+	class TestCallback extends Callback {
+
+		String name = null;
+		
+		public TestCallback (String name) {
+			this.name = name;
+		}
+		
+		public void onComplete(AsyncResult result) {
+			//System.out.println("On Complete Called for " + text);
+			SOAPBody body = result.getResponseEnvelope().getBody();
+			
+			OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+			if (echoStringResponseElem==null) { 
+				System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+				return;
+			}
+			
+			OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+			if (echoStringReturnElem==null) { 
+				System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+				return;
+			}
+			
+			String resultStr = echoStringReturnElem.getText();
+			System.out.println("Callback '" + name +  "' got result:" + resultStr);
+		}
+
+		public void onError (Exception e) {
+			// TODO Auto-generated method stub
+			System.out.println("Error reported for test call back");
+			e.printStackTrace();
+		}
+	}
+
+	
+}

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_3.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_3.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_3.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/rm1_1/clients/Scenario_2_3.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.rm1_1.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+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.axiom.soap.SOAPBody;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class Scenario_2_3 {
+	
+	private final static String applicationNamespaceName = "http://tempuri.org/"; 
+	private final static String echoString = "echoString";
+	private final static String Text = "Text";
+	private final static String Sequence = "Sequence";
+	private final static String echoStringResponse = "echoStringResponse";
+	private final static String EchoStringReturn = "EchoStringReturn";
+	
+	private static String toIP = "127.0.0.1";
+	private static String toPort = "9762";
+	private static String transportToIP = "127.0.0.1";
+	private static String transportToPort = "8070";
+	private static String servicePart = "/axis2/services/RMInteropService";
+	private static String toAddress = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws Exception,IOException {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+		Properties properties = new Properties();
+		if (in != null) {
+			properties.load(in);
+		}
+		
+		toAddress = properties.getProperty("to");
+		transportToEPR = properties.getProperty("transportTo");
+		
+		new Scenario_2_3 ().run();
+	}
+	
+	private void run () throws Exception {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+
+		ServiceClient serviceClient = new ServiceClient (configContext,null);	
+		
+		Options clientOptions = new Options ();
+		
+		EndpointReference toEPR = new EndpointReference (toAddress);
+		
+		
+		OMFactory factory = OMAbstractFactory.getOMFactory();
+		OMNamespace namespace = factory.createOMNamespace("urn:wsrm:InteropOptions","rmi");
+		OMElement acceptOfferElem = factory.createOMElement("acceptOffer",namespace);
+		OMElement useOfferElem = factory.createOMElement("useOffer",namespace);
+		acceptOfferElem.setText("false");
+		useOfferElem.setText("false");
+		toEPR.addReferenceParameter(acceptOfferElem);
+		toEPR.addReferenceParameter(useOfferElem);
+//		clientOptions.setManageSession(true); // without this reference params wont go.
+		serviceClient.setTargetEPR(toEPR);
+		
+		clientOptions.setProperty(Options.COPY_PROPERTIES,new Boolean (true));
+		clientOptions.setTo(toEPR);
+		
+		clientOptions.setAction("urn:wsrm:EchoString");
+		
+		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+		
+		String sequenceKey = "sequence4";
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+		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(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //single characted offers are declined by the server
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+		clientOptions.setUseSeparateListener(true);
+		
+		serviceClient.setOptions(clientOptions);
+
+		Callback callback1 = new TestCallback ("Callback 1");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
+		
+		Callback callback2 = new TestCallback ("Callback 2");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
+
+		
+		Callback callback3 = new TestCallback ("Callback 3");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
+		
+        while (!callback3.isComplete()) {
+            Thread.sleep(1000);
+        }
+        
+       
+        SandeshaClient.terminateSequence(serviceClient);
+//        serviceClient.finalizeInvoke();
+	}
+
+	private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+		OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+		OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+		
+		textElem.setText(text);
+		sequenceElem.setText(sequenceKey);
+		echoStringElement.addChild(textElem);
+		echoStringElement.addChild(sequenceElem);
+		
+		return echoStringElement;
+	}
+
+	class TestCallback extends Callback {
+
+		String name = null;
+		
+		public TestCallback (String name) {
+			this.name = name;
+		}
+		
+		public void onComplete(AsyncResult result) {
+			//System.out.println("On Complete Called for " + text);
+			SOAPBody body = result.getResponseEnvelope().getBody();
+			
+			OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+			if (echoStringResponseElem==null) { 
+				System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+				return;
+			}
+			
+			OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+			if (echoStringReturnElem==null) { 
+				System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+				return;
+			}
+			
+			String resultStr = echoStringReturnElem.getText();
+			System.out.println("Callback '" + name +  "' got result:" + resultStr);
+		}
+
+		public void onError (Exception e) {
+			// TODO Auto-generated method stub
+			System.out.println("Error reported for test call back");
+			e.printStackTrace();
+		}
+	}
+
+	
+}

Added: webservices/sandesha/trunk/java/interop/src/sandesha2/interop/service/RMInteropService.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/sandesha2/interop/service/RMInteropService.java?view=auto&rev=441051
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/sandesha2/interop/service/RMInteropService.java (added)
+++ webservices/sandesha/trunk/java/interop/src/sandesha2/interop/service/RMInteropService.java Thu Sep  7 03:49:11 2006
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.interop.service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+
+public class RMInteropService {
+
+	private static Map sequenceStrings = new HashMap();  //TODO make this non static
+	private final String applicationNamespaceName = "http://tempuri.org/"; 
+	private final String Text = "Text";
+	private final String Sequence = "Sequence";
+	private final String echoStringResponse = "echoStringResponse";
+	private final String EchoStringReturn = "EchoStringReturn";
+	
+	public OMElement echoString(OMElement in) throws Exception {
+		
+		OMElement textElem = in.getFirstChildWithName(new QName (applicationNamespaceName,Text));
+		OMElement sequenceElem = in.getFirstChildWithName(new QName (applicationNamespaceName,Sequence));
+		
+		if (textElem==null)
+			throw new Exception ("'Text' element is not present as a child of the 'echoString' element");
+		if (sequenceElem==null)
+			throw new Exception ("'Sequence' element is not present as a child of the 'echoString' element");
+		
+		String textStr = textElem.getText();
+		String sequenceStr = sequenceElem.getText();
+		
+		System.out.println("'EchoString' service got text '" + textStr + "' for the sequence '" + sequenceStr + "'");
+		
+		String previousText = (String) sequenceStrings.get(sequenceStr);
+		String resultText = (previousText==null)?textStr:previousText+textStr;
+		sequenceStrings.put(sequenceStr,resultText);
+		
+		
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringResponseElem = fac.createOMElement(echoStringResponse, applicationNamespace);
+		OMElement echoStringReturnElem = fac.createOMElement(EchoStringReturn, applicationNamespace);
+		
+		echoStringReturnElem.setText(resultText);
+		echoStringResponseElem.addChild(echoStringReturnElem);
+		
+		return echoStringResponseElem;
+	}
+  
+	public void ping(OMElement in) throws Exception  {
+		OMElement textElem = in.getFirstChildWithName(new QName (applicationNamespaceName,Text));
+		if (textElem==null)
+			throw new Exception ("'Text' element is not present as a child of the 'Ping' element");
+		
+		String textValue = textElem.getText();
+		
+		System.out.println("ping service got text:" + textValue);
+	}
+	
+}



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