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/06/15 07:51:24 UTC

svn commit: r414476 [2/15] - in /webservices/sandesha/trunk: ./ c/ config/ interop/ java/ java/config/ java/interop/ java/interop/conf/ java/interop/src/ java/interop/src/org/ java/interop/src/org/apache/ java/interop/src/org/apache/sandesha2/ java/int...

Added: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_1_4.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_1_4.java?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_1_4.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_1_4.java Wed Jun 14 22:51:15 2006
@@ -0,0 +1,176 @@
+/*
+ * 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 org.apache.sandesha2.wsrm_2006_02;
+
+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;
+
+/**
+ * @author Chamikara Jayalath <ch...@gmail.com>
+ */
+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/org/apache/sandesha2/wsrm_2006_02/Scenario_2_1.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_1.java?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_1.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_1.java Wed Jun 14 22:51:15 2006
@@ -0,0 +1,239 @@
+/*
+ * 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 org.apache.sandesha2.wsrm_2006_02;
+
+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;
+
+/**
+ * @author Chamikara Jayalath <ch...@gmail.com>
+ */
+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/org/apache/sandesha2/wsrm_2006_02/Scenario_2_2.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_2.java?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_2.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_2.java Wed Jun 14 22:51:15 2006
@@ -0,0 +1,207 @@
+/*
+ * 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 org.apache.sandesha2.wsrm_2006_02;
+
+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;
+
+/**
+ * @author Chamikara Jayalath <ch...@gmail.com>
+ */
+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/org/apache/sandesha2/wsrm_2006_02/Scenario_2_3.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_3.java?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_3.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/wsrm_2006_02/Scenario_2_3.java Wed Jun 14 22:51:15 2006
@@ -0,0 +1,222 @@
+/*
+ * 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 org.apache.sandesha2.wsrm_2006_02;
+
+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;
+
+/**
+ * @author Chamikara Jayalath <ch...@gmail.com>
+ */
+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/maven.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/maven.xml?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/maven.xml (added)
+++ webservices/sandesha/trunk/java/maven.xml Wed Jun 14 22:51:15 2006
@@ -0,0 +1,350 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project default="default" xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns:deploy="deploy" xmlns:ant="jelly:ant">
+
+    <j:set var="dist.name" value="${pom.artifactId}-${sandesha2.version}"/>
+    <j:set var="dist.module.name" value="${pom.artifactId}-${sandesha2.module.version}"/>
+
+    <ant:property name="build.dist.dir" value="${maven.build.dir}/dist"/>
+    <ant:property name="build.temp.dir" value="${maven.build.dir}/temp"/>
+    <ant:property name="build.repo.dir" value="${maven.build.dir}/repos"/>
+    <ant:property name="build.samples.dir" value="${maven.build.dir}/samples"/>
+    <ant:property name="build.samples.services.dir" value="${build.samples.dir}/services"/>
+    <ant:property name="build.samples.clients.dir" value="${build.samples.dir}/clients"/>
+    
+	<ant:property name="mar.name" value="${dist.module.name}.mar"/>
+	<ant:property name="jar.name" value="${dist.name}.jar"/>
+	<ant:property name="client.jar.name" value="${pom.artifactId}-client-${sandesha2.version}.jar"/>
+	
+	<ant:property name="dir.samples" value="samples"/>
+	<ant:property name="dir.test.resources" value="test-resources"/>
+	<ant:property name="dir.config" value="config"/>
+	
+	<ant:property name="apache.license.file" value="LICENSE.txt" />
+	<ant:property name="readme.file" value="README.txt" />
+	<ant:property name="release.notes.file" value="release-notes.html" />
+	
+	<ant:property name="repo.addressing.mar.full.name" value="${repo.addressing.mar.name}-${addressing.version}.mar" />
+	<ant:property name="repo.addressing.mar.path" value="${maven.repo.local}/axis2/mars" />
+	<ant:property name="repo.addressing.mar" value="${repo.addressing.mar.path}/${repo.addressing.mar.full.name}" />
+   
+    <goal name="build:all" prereqs="mar,jar,client:jar,sample:create,repo:create,test:test" />
+    
+    <goal name="all:jar" prereqs="mar,jar,client:jar" />
+        
+    <goal name="default">
+        <attainGoal name="clean"/>
+        <attainGoal name="build:all"/>
+    </goal>
+    
+    <!-- Befor running the tests the repo should be created-->
+    <preGoal name="test:test">
+       <attainGoal name="repo:create"/>
+    </preGoal>
+    
+    <goal name="mar" prereqs="java:compile">
+    	<ant:property name="metainf.path" value="${build.temp.dir}/module/META-INF" />
+    	<ant:mkdir dir="${metainf.path}" />
+    	<ant:copy file="${basedir}/config/module.xml" todir="${metainf.path}" />
+
+		<!-- For the client side -->
+        <copy todir="${build.temp.dir}/module">
+            <fileset dir="${basedir}/target/classes" >
+            	<include name="**/*.class"/>
+            </fileset>
+        </copy>
+  
+        <ant:jar jarfile="${maven.build.dir}/${mar.name}" basedir="${build.temp.dir}/module" /> 
+        
+        <copy file="${maven.build.dir}/${mar.name}" 
+            tofile="${maven.repo.local}/${pom.artifactId}/mars/${mar.name}"/>
+        
+        <delete dir="${build.temp.dir}" />
+    </goal>
+    
+    <goal name="jar" prereqs="java:compile">
+    	<ant:property name="jar.temp.path" value="${build.temp.dir}/jar" />
+    	<ant:mkdir dir="${jar.temp.path}" />
+
+        <copy todir="${jar.temp.path}">
+            <fileset dir="${basedir}/target/classes" >
+            	<include name="**/*.class"/>
+            </fileset>
+        </copy>
+  
+        <ant:jar jarfile="${maven.build.dir}/${jar.name}" basedir="${jar.temp.path}" /> 
+        
+        <copy file="${maven.build.dir}/${jar.name}" 
+            toDir="${maven.repo.local}/${pom.artifactId}/jars"/>
+        
+        <delete dir="${build.temp.dir}" />
+    </goal>
+    
+    <goal name="client:jar" prereqs="java:compile">
+    	<ant:property name="client.path" value="${build.temp.dir}/client/" />
+    	<ant:mkdir dir="${client.path}" />
+
+		<!-- For the client side -->
+        <copy todir="${build.temp.dir}/client">
+            <fileset dir="${basedir}/target/classes" >
+              <include name="**/sandesha2/client/*SandeshaClientConstants*.*" />
+              <include name="**/sandesha2/client/*SandeshaListener*.*" />
+              <include name="**/sandesha2/client/*SequenceReport*.*" />
+            </fileset>
+        </copy>
+  
+        <ant:jar jarfile="${maven.build.dir}/${client.jar.name}" basedir="${build.temp.dir}/client" /> 
+        
+        <copy file="${maven.build.dir}/${client.jar.name}" 
+            tofile="${maven.repo.local}/${pom.artifactId}/jars/${client.jar.name}"/>
+            
+        <delete dir="${build.temp.dir}" />
+        
+    </goal>
+
+	<goal name="client:create" prereqs="mar">
+		<ant:property name="client.dist.path" value="${build.repo.dir}/client"/>
+		<ant:mkdir dir="${client.dist.path}" />
+		<ant:mkdir dir="${client.dist.path}/modules" />
+		<ant:copy file="${dir.config}/client_axis2.xml" todir="${client.dist.path}" />
+		<ant:copy file="${maven.build.dir}/${mar.name}" todir="${client.dist.path}/modules" />
+		
+		<!-- Copying addressing mar file--> 
+		<ant:copy file="${repo.addressing.mar}" toDir="${client.dist.path}/modules/" />    
+	</goal>
+
+    <goal name="repo:create">
+        <attainGoal name="server:create"/>
+        <attainGoal name="client:create"/>
+    </goal>	
+    
+	<goal name="server:create" prereqs="mar,sample:create">
+		<ant:property name="server.dist.path" value="${build.repo.dir}/server"/>
+		<ant:mkdir dir="${server.dist.path}" />
+		<ant:mkdir dir="${server.dist.path}/modules" />
+		<ant:mkdir dir="${server.dist.path}/services" />
+		<ant:copy file="${basedir}/config/server_axis2.xml" todir="${server.dist.path}" />
+		<ant:copy file="${maven.build.dir}/${mar.name}" todir="${server.dist.path}/modules" /> 
+        <ant:copy todir="${server.dist.path}/services" >
+            <ant:fileset dir="${build.samples.services.dir}">
+                <ant:include name="**/*.aar" />
+            </ant:fileset>
+        </ant:copy>
+        
+        <!-- Copying addressing mar file-->
+        <ant:copy file="${repo.addressing.mar}" toDir="${server.dist.path}/modules/" /> 
+	</goal>
+	
+    <goal name="sample:compile">
+        <ant:mkdir dir="${basedir}/target/samples/classes" />
+        <ant:mkdir dir="${basedir}/target/samples/services" />
+        
+        <ant:javac srcdir="${dir.samples}/src" destdir="${basedir}/target/samples/classes" debug="on">
+            <ant:classpath refid="maven.dependency.classpath" />
+	    	<ant:classpath path="${basedir}/target/classes" />
+        </ant:javac>
+    </goal>
+
+    <goal name="sample:create" prereqs="sample:setup,sample:userguide:create">
+    </goal>
+    
+    <goal name="sample:setup" prereqs="sample:compile">
+        <ant:mkdir dir="${build.samples.services.dir}" />
+        <ant:mkdir dir="${build.samples.clients.dir}" />
+    </goal>
+    
+    <goal name="sample:userguide:create" prereqs="sample:compile,sample:setup">
+        <ant:property name="dir.sample.userguide.temp" value="${build.temp.dir}/userguide" />
+        <ant:property name="dir.sample.userguideclients.temp" value="${build.temp.dir}/userguideclients" />
+        <ant:property name="userguide.service.aar.name" value="RMSampleService.aar" />
+        <ant:property name="userguide.client.jar.name" value="UserguideSampleClients.jar" />
+        
+        <ant:mkdir dir="${build.samples.clients.dir}" />
+        
+        <ant:mkdir dir="${dir.sample.userguide.temp}" />
+        <ant:mkdir dir="${dir.sample.userguide.temp}/META-INF" />
+        <ant:copy file="${dir.samples}/conf/userguide/services.xml" todir="${dir.sample.userguide.temp}/META-INF" /> 
+        <!-- <ant:copy file="${dir.samples}/conf/userguide/RMSampleService.wsdl" todir="${dir.sample.userguide.temp}" /> --> 
+        <ant:copy todir="${dir.sample.userguide.temp}" >
+            <ant:fileset dir="${maven.build.dir}/samples/classes">
+                <ant:include name="sandesha2/samples/userguide/**/*Service*.class" />
+            </ant:fileset>
+        </ant:copy>
+        
+        <ant:mkdir dir="${dir.sample.userguideclients.temp}" /> 
+        <ant:copy todir="${dir.sample.userguideclients.temp}" >
+            <ant:fileset dir="${maven.build.dir}/samples/classes">
+                <ant:include name="sandesha2/samples/userguide/**/*Client*.class" />
+            </ant:fileset>
+        </ant:copy>
+        
+        <ant:jar jarfile="${build.samples.services.dir}/${userguide.service.aar.name}" basedir="${dir.sample.userguide.temp}" />
+    	<ant:jar jarfile="${build.samples.clients.dir}/${userguide.client.jar.name}" basedir="${dir.sample.userguideclients.temp}" />
+    	 
+    	<ant:copy todir="${build.samples.clients.dir}" >
+            <ant:fileset dir="${dir.samples}/conf/userguide">
+                <ant:include name="*.bat" />
+                <ant:include name="*.sh" />
+                <ant:include name="*.html" />
+            </ant:fileset>
+        </ant:copy>
+         
+    	<!-- <delete dir="${build.temp.dir}" /> -->
+    </goal>
+    
+    <preGoal name="test:test" > 
+       <!--
+    	<attainGoal name="server:create"/>
+    	<attainGoal name="client:create"/>   
+    	-->
+    </preGoal>
+    
+    <goal name="server.copy.tomcat" prereqs="server:create">
+        <property environment="env1"/>
+        <property name="webapps" value="${env1.CATALINA_HOME}/webapps"/>
+        <ant:copy file="${build.repo.dir}/server/modules/${mar.name}" todir="${webapps}/axis2/WEB-INF/modules"/>
+        <ant:copy todir="${webapps}/axis2/WEB-INF/services" >
+            <ant:fileset dir="${build.repo.dir}/server/services">
+                <ant:include name="*.aar" />
+            </ant:fileset>
+        </ant:copy>
+    </goal> 
+
+    <!-- to transforme htmls to xdocs -->
+    <preGoal name="xdoc:jelly-transform">
+        <attainGoal name="html2xdoc"/>
+    </preGoal>
+
+    <goal name="clean">
+        <delete dir="target"/>
+        <delete dir="${build.temp.dir}" />
+        <ant:delete>
+            <ant:fileset dir=".">
+                <ant:include name="**/axis.log"/>
+                <ant:include name="**/junit*.properties"/>
+                <ant:include name="**/temp.properties"/>
+            </ant:fileset>
+        </ant:delete>
+    </goal>
+
+    <!-- ================================================================ -->
+    <!--- Create the Binary Distribution -->
+    <!-- ================================================================ -->
+
+    <goal name="dist-bin" prereqs="build:all,javadoc">
+        <property name="dir.temp.dist.bin.parent" value="${build.temp.dir}/dist-bin" />
+        <property name="dir.temp.dist.bin" value="${build.temp.dir}/dist-bin/${dist.name}-bin" />
+        
+        <ant:mkdir dir="${dir.temp.dist.bin}"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/docs"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/samples"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients/services"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients/modules"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/samples/clients/lib"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/samples/services"/>
+        <ant:mkdir dir="${dir.temp.dist.bin}/docs/api"/>
+    
+    	<ant:copy file="${dir.config}/client_axis2.xml" todir="${dir.temp.dist.bin}/samples/clients" />
+    	        
+        <ant:copy todir="${dir.temp.dist.bin}/docs/api">
+            <ant:fileset dir="target/docs/apidocs/">
+                <ant:include name="**"/>
+            </ant:fileset>
+        </ant:copy>
+        
+        <ant:copy todir="${dir.temp.dist.bin}/docs/api">
+            <ant:fileset dir="target/docs/apidocs/">
+                <ant:include name="**"/>
+            </ant:fileset>
+        </ant:copy>
+   
+        <ant:copy todir="${dir.temp.dist.bin}/docs">
+            <ant:fileset dir="xdocs">
+                <ant:include name="**"/>
+            </ant:fileset>
+        </ant:copy>
+  
+       <!--  <ant:copy todir="${dir.temp.dist.bin}/lib" flatten="true">
+            <ant:fileset dir="target/lib">
+                <ant:include name="*.jar"/>
+            </ant:fileset>
+        </ant:copy> -->
+    
+        <ant:copy file="target/${jar.name}" todir="${dir.temp.dist.bin}" />
+        <ant:copy file="target/${mar.name}" todir="${dir.temp.dist.bin}" />
+        <ant:copy file="target/${client.jar.name}" todir="${dir.temp.dist.bin}" />
+       <!-- <ant:copy file="${dir.config}/sandesha2.properties" todir="${dir.temp.dist.bin}" /> -->
+        <ant:copy file="${apache.license.file}" todir="${dir.temp.dist.bin}" />
+        <ant:copy file="${release.notes.file}" todir="${dir.temp.dist.bin}" />
+        <ant:copy file="${readme.file}" todir="${dir.temp.dist.bin}" />
+        
+        <ant:copy todir="${dir.temp.dist.bin}/samples">
+            <ant:fileset dir="${build.samples.dir}">
+                <ant:include name="classes/**/*.class" />
+                <ant:include name="clients/*.jar" />
+                <ant:include name="clients/*.bat"/>
+                <ant:include name="clients/*.sh"/>
+                <ant:include name="clients/*.xml"/>
+                <ant:include name="clients/*.html"/>
+            </ant:fileset>
+        </ant:copy>
+    
+        <ant:copy todir="${dir.temp.dist.bin}/samples/services">
+            <ant:fileset dir="${build.repo.dir}/server/services">
+                <ant:include name="*.aar" />
+            </ant:fileset>
+        </ant:copy>
+   
+        <mkdir dir="${build.dist.dir}" />
+    
+        <ant:zip file="${build.dist.dir}/${dist.name}-bin.zip" basedir="${dir.temp.dist.bin.parent}" />
+        <ant:tar tarfile="${build.dist.dir}/${dist.name}-bin.tar" basedir="${dir.temp.dist.bin.parent}" />
+        <gzip src="${build.dist.dir}/${dist.name}-bin.tar" zipfile="${build.dist.dir}/${dist.name}-bin.tar.gz" />
+       
+        <ant:delete file="${build.dist.dir}/${dist.name}-bin.tar" />
+        
+    </goal>
+
+
+    <!-- ================================================================ -->
+    <!--- Create the Source Distribution -->
+    <!-- ================================================================ -->
+
+    <goal name="dist-src">
+
+    	<mkdir dir="${build.dist.dir}" />
+    	
+    	<ant:zip file="${build.dist.dir}/${dist.name}-src.zip">
+   			<ant:fileset dir=".">
+    			<ant:include name="**"/>
+    			<ant:exclude name="**/target/**"/>
+    			<ant:exclude name="**/.svn/**"/>
+    			<ant:exclude name="**/bin/**"/>
+    			<ant:exclude name=".*"/>
+    			<ant:exclude name="**/*.license"/>
+    		</ant:fileset>
+    	</ant:zip>
+    	
+    	<ant:tar tarfile="${build.dist.dir}/${dist.name}-src.tar" longfile="gnu">
+   			<ant:tarfileset dir=".">
+    			<ant:include name="**"/>
+    			<ant:exclude name="**/target/**"/>
+    			<ant:exclude name="**/.svn/**"/>
+   				<ant:exclude name="**/bin/**"/>
+    			<ant:exclude name=".*"/>
+    			<ant:exclude name="**/*.license"/>
+    		</ant:tarfileset>
+    	</ant:tar>
+    	 
+    	<gzip src="${build.dist.dir}/${dist.name}-src.tar" zipfile="${build.dist.dir}/${dist.name}-src.tar.gz"/>
+    	<ant:delete file="${build.dist.dir}/${dist.name}-src.tar"/>
+    	
+    </goal>
+
+    <goal name="dist" prereqs="clean">
+        <attainGoal name="dist-bin" />
+        <attainGoal name="dist-src" />
+    </goal>
+
+</project>

Added: webservices/sandesha/trunk/java/project.properties
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/project.properties?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/project.properties (added)
+++ webservices/sandesha/trunk/java/project.properties Wed Jun 14 22:51:15 2006
@@ -0,0 +1,44 @@
+# -----------------------------------------------------------------------------
+# Default properties for the Maven build. You can override these properties
+# either by defining a build.properties file with the overriden properties
+# or by passing them on the command line as system parameters (-D).
+# -----------------------------------------------------------------------------
+
+# MAVEN CORE
+##############
+# comma-spearated list of remote JAR repository URLs
+maven.repo.remote=http://www.ibiblio.org/maven/,\
+                  http://people.apache.org/repository/,\
+                  http://dist.codehaus.org/,\
+
+# XDOC PLUGIN
+###############
+# Display project version and date on web site
+maven.xdoc.date = left
+maven.xdoc.version = ${pom.currentVersion}
+
+sandesha2.version=SNAPSHOT
+sandesha2.module.version=SNAPSHOT
+
+maven.html2xdoc.enabled=false
+maven.html2xdoc.dir=./xdocs
+
+annogen.version=0.1.0
+backport_util_concurrent.version=2.1
+addressing.version=1.0
+axiom.version=SNAPSHOT
+axis2.version=SNAPSHOT
+commons.codec.version=1.3
+commons.httpclient.version=3.0
+commons.logging.version=1.0.4
+log4j.version=1.2.13
+neethi.version=SNAPSHOT
+stax.api.version=1.0
+stax.impl.groupid=woodstox
+stax.impl.artifactid=wstx
+stax.impl.version=asl-2.9.3
+wsdl4j.version=1.5.2
+XmlSchema.version=1.0.2
+jakarta.httpcore.version=4.0-alpha2
+
+repo.addressing.mar.name=addressing

Added: webservices/sandesha/trunk/java/project.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/project.xml?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/project.xml (added)
+++ webservices/sandesha/trunk/java/project.xml Wed Jun 14 22:51:15 2006
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project>
+    <pomVersion>3</pomVersion>
+    <id>sandesha2</id>
+    <name>Apache Sandesha2</name>
+	<groupId>sandesha2</groupId>
+    <currentVersion>${sandesha2.version}</currentVersion>
+    <organization>
+        <name>Apache Web Services</name>
+        <url>http://ws.apache.org/</url>
+        <logo>http://www.apache.org/images/asf-logo.gif</logo>
+    </organization>
+    <inceptionYear>2005</inceptionYear>
+    <package>org.apache.sandesha2</package>
+    <logo>http://ws.apache.org/ws-fx/sandesha/images/Sandesha.jpg</logo>
+    <description>
+Sandesha2 is an implementation of WS-ReliableMessaging specification published IBM, Microsoft, BEA and TIBCO. Sandesha2 was built on top of Axis2. So by using Sandesha2 you can add reliable messaging capability to the web services you have hosted using Axis2. You can also use Sandesha2 with Axis2 client to interact with already hosted web services in a reliable manner. Please see sandesha2 user guide for more information on using Sandesha2. Read Sandesha2 Architecture guide to see how Sandesha2 work internally.
+    </description>
+    <shortDescription>WS-ReliableMessaging implementation for Apache Axis2</shortDescription>
+    <url>http://ws.apache.org/ws-fx/sandesha/sandesha2</url>
+    <issueTrackingUrl>http://issues.apache.org/jira/browse/SAND</issueTrackingUrl>
+    <siteAddress>ws.apache.org</siteAddress>
+    <siteDirectory>/ws-fx/sandesha/sandesha2</siteDirectory>
+    <distributionDirectory>/www/ws.apache.org/builds/</distributionDirectory>
+
+    <repository>
+        <connection></connection>
+        <url>http://svn.apache.org/repos/asf/webservices/sandesha/trunk</url>
+    </repository>
+
+    <mailingLists>
+        <mailingList>
+            <name>Sandesha Developer List</name>
+            <subscribe>sandesha-dev-subscribe@ws.apache.org</subscribe>
+            <unsubscribe>sandesha-dev-unsubscribe@ws.apache.org</unsubscribe>
+            <archive></archive>
+        </mailingList>
+    </mailingLists>
+
+    <developers>
+        <developer>
+            <name>Sanjiva Weerawarana</name>
+            <id>sanjiva</id>
+            <email>sanjiva@opensource.lk</email>
+            <organization>
+            </organization>
+        </developer>
+        <developer>
+            <name>Davanum Srinivas</name>
+            <id>dims</id>
+            <email>dims@yahoo.com</email>
+            <organization>
+            </organization>
+        </developer>
+        <developer>
+            <name>Jaliya Ekanayake</name>
+            <id>jaliya</id>
+            <email>jaliya@apache.org</email>
+            <organization>
+            </organization>
+        </developer>
+        <developer>
+            <name>Chamikara Jayalath</name>
+            <id>chamikara</id>
+            <email>chamikaramj@gmail.com</email>
+            <organization>
+            </organization>
+        </developer>
+    </developers>
+
+    <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <build>
+        <nagEmailAddress>jaliya@apache.org</nagEmailAddress>
+        <sourceDirectory>src</sourceDirectory>
+        <unitTestSourceDirectory>test/src</unitTestSourceDirectory>
+        <unitTest>
+            <includes>
+                <include>**/*Test.java</include>
+            </includes>
+            <resources>
+                <resource>
+                    <directory>test-resources</directory>
+                    <includes>
+                        <include>**/*.xml</include>
+                    </includes>
+                </resource>
+            </resources>
+        </unitTest>
+    </build>
+
+    <!-- ============ -->
+    <!-- Dependencies -->
+    <!-- ============ -->
+
+    <dependencies>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>addressing</artifactId>
+            <version>${addressing.version}</version>
+            <type>mar</type>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>${commons.logging.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>${log4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>${commons.codec.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>${commons.httpclient.version}</version>
+        </dependency>
+	  <dependency>
+            <groupId>httpcomponents-httpcore</groupId>
+            <artifactId>jakarta-httpcore</artifactId>
+            <version>${jakarta.httpcore.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>${stax.api.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${stax.impl.groupid}</groupId>
+            <artifactId>${stax.impl.artifactid}</artifactId>
+            <version>${stax.impl.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>${wsdl4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>neethi</artifactId>
+            <version>${neethi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-dom</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>${XmlSchema.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>annogen</groupId>
+            <artifactId>annogen</artifactId>
+            <version>${annogen.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
+            <version>${backport_util_concurrent.version}</version>
+        </dependency>                   
+    </dependencies>
+
+    <!-- ======= -->
+    <!-- Reports -->
+    <!-- ======= -->
+    <reports>
+
+       <report>maven-javadoc-plugin</report>
+    
+       <!--
+       <report>maven-license-plugin</report>
+       <report>maven-checkstyle-plugin</report>
+       <report>maven-pmd-plugin</report>
+       <report>maven-jdepend-plugin</report>
+       <report>maven-changelog-plugin</report>
+
+       <report>maven-file-activity-plugin</report>
+
+       <report>maven-developer-activity-plugin</report>
+
+       <report>maven-jxr-plugin</report>
+
+       <report>maven-junit-report-plugin</report>
+
+       <report>maven-clover-plugin</report>
+       -->
+       
+    </reports>
+    
+</project>
+

Added: webservices/sandesha/trunk/java/release-notes.html
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/release-notes.html?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/release-notes.html (added)
+++ webservices/sandesha/trunk/java/release-notes.html Wed Jun 14 22:51:15 2006
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+  <title>Apache Sandesha2 - release notes</title>
+  <meta name="generator" content="amaya 9.2.2, see http://www.w3.org/Amaya/"
+  />
+</head>
+
+<body>
+<h1>Apache Sandesha2 Release Notes</h1>
+
+<p>This is the 1.0 release of Apache Sandesha2.</p>
+
+<h2>What is in this release</h2>
+
+<p>Features available on this release of Sandesha2.</p>
+<ol>
+  <li>Support for WS-ReliableMessaging in both client side and server side of
+    Axis2. (according the the WS-ReliableMessaging specification February
+    2005).</li>
+  <li>Pluggable storage framework.</li>
+  <li>Configurable delivery assurances. In-order exactly once delivery
+    assurance is guaranteed. Users can also instruct the system to stop
+    ordering (this will give a higher performance).</li>
+  <li>Support for both SOAP 1.1 and 1.2.</li>
+  <li>Mechanisms to support WS-ReliableMessaging policy assertions in both
+    server side and the client side.</li>
+  <li>Improved client API, which provides features for both general and
+    advance users.</li>
+  <li>Sandesha Report functionality to get status information on Sandesha2
+    system and its sequences.</li>
+  <li>SandeshaListner feature to get informed when specific events happen
+    (for example when a fault is retrieved or when a sequence times out).</li>
+  <li>Support for the WSRM specification being developed under OASIS WSRX
+    technical committee.</li>
+  <li>Test cases to test RM scenarios.</li>
+  <li>Documentation</li>
+</ol>
+
+<p>Thank you for using Apache Sandesha2.</p>
+
+<p></p>
+
+<p>Apache Sandesha2 team</p>
+
+<p></p>
+
+<p></p>
+
+<p></p>
+
+<p></p>
+
+<p></p>
+
+<p></p>
+</body>
+</html>

Added: webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.bat?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.bat (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.bat Wed Jun 14 22:51:15 2006
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.AsyncEchoClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.sh?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.sh (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/AsyncEchoClient.sh Wed Jun 14 22:51:15 2006
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.AsyncEchoClient ./

Added: webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.bat?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.bat (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.bat Wed Jun 14 22:51:15 2006
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.AsyncPingClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.sh?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.sh (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/AsyncPingClient.sh Wed Jun 14 22:51:15 2006
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.AsyncPingClient ./

Added: webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.bat?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.bat (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.bat Wed Jun 14 22:51:15 2006
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.SyncEchoClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.sh?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.sh (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/SyncEchoClient.sh Wed Jun 14 22:51:15 2006
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.SyncEchoClient ./

Added: webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.bat?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.bat (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.bat Wed Jun 14 22:51:15 2006
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.SyncPingClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.sh?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.sh (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/SyncPingClient.sh Wed Jun 14 22:51:15 2006
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.SyncPingClient ./

Added: webservices/sandesha/trunk/java/samples/conf/userguide/services.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/services.xml?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/services.xml (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/services.xml Wed Jun 14 22:51:15 2006
@@ -0,0 +1,33 @@
+<service name="RMSampleService">
+   <parameter name="ServiceClass" locked="xsd:false">sandesha2.samples.userguide.RMSampleService</parameter>
+
+
+
+    <description>
+        The userguide Sample service.
+    </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">
+	        
+	      <!-- Following policy value has been overrided from the default values.-->> 
+	      <wsrm:AcknowledgementInterval>3500</wsrm:AcknowledgementInterval>
+	    
+	   
+	</wsp:Policy>
+    
+    
+</service>
\ No newline at end of file

Added: webservices/sandesha/trunk/java/samples/conf/userguide/userguide_sample.html
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/conf/userguide/userguide_sample.html?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/conf/userguide/userguide_sample.html (added)
+++ webservices/sandesha/trunk/java/samples/conf/userguide/userguide_sample.html Wed Jun 14 22:51:15 2006
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+  <title>Sandesha2 Samples Guide</title>
+  <meta name="generator" content="amaya 9.2.2, see http://www.w3.org/Amaya/"
+  />
+</head>
+
+<body>
+<h1>How to run the userguide sample</h1>
+
+<h2>Setting up the server</h2>
+
+<p>Install tomcat and add the Axis2 web app.</p>
+
+<p>Add an user phase named RMPhase to both inFlow and outFlow of
+axis2.xml.</p>
+
+<p>Add the Sandesha2 module to the &lt;AXIS2_WEBAPP&gt;\WEB-INF\modules
+directory.</p>
+
+<p>Start tomcat.</p>
+
+<h2>Setting up the client</h2>
+
+<p>We have made a client repo available at the directory samples\clients
+directory of the Sandesha2 binary distribution.</p>
+
+<p>Add all the jar files that come with the lib directory of Apache Axis2
+binary distrubution to the samples\clients\lib directory.</p>
+
+<p>Add the Sandesha2 jar file that comes with the binary distribution to the
+samples\clients\lib directory.</p>
+
+<p>Add the addressing module file that comes with Apache Axis2 to the
+samples\clients\modules directory.</p>
+
+<p>Add the Sandesha2 module file that comes with Apache Sandesha2 binary
+distribution to samples\clients\modules directory.</p>
+
+<h2>Setting up the tcp monitor.</h2>
+
+<p>start the tcp monitor utility program and map following ports.</p>
+
+<p>8070 -&gt; 8080 (assuming that you started tomcat in the port 8080)</p>
+
+<p>9070 -&gt; 6060 (assuming that your Axis2 client port is 6060)</p>
+
+<h2>Running the sample clients</h2>
+
+<p>Simply double click the the bat files that come in the samples\client
+directory of the Sandesha2 binary distribution to run various samples clients
+and observe tcp monitor to see the message exchange.</p>
+</body>
+</html>

Added: webservices/sandesha/trunk/java/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java (added)
+++ webservices/sandesha/trunk/java/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java Wed Jun 14 22:51:15 2006
@@ -0,0 +1,57 @@
+/*
+ * 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.samples.simpleServer;
+
+import java.io.File;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+public class SimpleSandesha2Server {
+
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_SERVER_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "server" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws AxisFault {
+
+		String axisServerRepo = null;
+		if (args!=null && args.length>0)
+			axisServerRepo = args[0];
+		
+		if (axisServerRepo!=null && !"".equals(axisServerRepo)) {
+			AXIS2_SERVER_PATH = axisServerRepo;
+		}
+
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory.");
+			return;
+		}
+		
+		System.out.println("Starting sandesha2 server...");
+		
+		String axis2_xml = AXIS2_SERVER_PATH + "server_axis2.xml";
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_SERVER_PATH,axis2_xml);
+		
+		SimpleHTTPServer server = new SimpleHTTPServer  (configContext,8080);
+		
+		server.start();
+		
+	}
+}

Added: webservices/sandesha/trunk/java/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java?rev=414476&view=auto
==============================================================================
--- webservices/sandesha/trunk/java/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java (added)
+++ webservices/sandesha/trunk/java/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java Wed Jun 14 22:51:15 2006
@@ -0,0 +1,179 @@
+/*
+ * 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.samples.userguide;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+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.client.SandeshaClientConstants;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class AsyncEchoBlockingClient {
+	
+	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 EchoStringReturn = "EchoStringReturn";
+	
+	private String toIP = "127.0.0.1";
+	
+	private String toPort = "8070";
+	
+	private String transportToPort = "8070";
+	
+	private String toEPR = "http://" + toIP +  ":" + toPort + "/axis2/services/RMSampleService";
+	
+	private String transportToEPR = "http://" + toIP +  ":" + transportToPort + "/axis2/services/RMSampleService";
+	
+	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 {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		new AsyncEchoBlockingClient ().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.setTo(new EndpointReference (toEPR));
+		
+		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress() + "/" + ServiceClient.ANON_OUT_IN_OP;
+		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(SandeshaClient.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.
+		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);
+
+		clientOptions.setTimeOutInMilliSeconds(40000);
+		
+		OMElement result = serviceClient.sendReceive (getEchoOMBlock("echo1",sequenceKey));
+		showResult(result);
+		
+		result = serviceClient.sendReceive (getEchoOMBlock("echo2",sequenceKey));
+		showResult(result);
+		
+		result = serviceClient.sendReceive(getEchoOMBlock("echo3",sequenceKey));
+		showResult(result);
+		
+		result = serviceClient.sendReceive(getEchoOMBlock("echo4",sequenceKey));
+		showResult(result);
+		
+		clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
+		OMElement bodyElem = getEchoOMBlock("echo5",sequenceKey);
+		
+		result = serviceClient.sendReceive(bodyElem);
+		showResult(result);
+		        
+        Thread.sleep(4000);
+	}
+
+	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);
+		
+		OMNamespace namespace = fac.createOMNamespace(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,"env");
+		OMAttribute attr = fac.createOMAttribute("encodingStyle", namespace,"http://schemas.xmlsoap.org/soap/encoding/");
+		
+		echoStringElement.addAttribute(attr);
+		
+		return echoStringElement;
+	}
+
+    private void showResult (OMElement echoStringResponseElem) {
+		
+		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("Got result:" + resultStr);
+    }	
+}



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