You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2005/11/06 20:06:01 UTC

svn commit: r331140 - in /webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop: clients/AsyncEchoClient.java clients/AsyncPingClient.java clients/SyncEchoClient.java clients/SyncPingClient.java service/RMInteropService.java

Author: chamikara
Date: Sun Nov  6 11:05:09 2005
New Revision: 331140

URL: http://svn.apache.org/viewcvs?rev=331140&view=rev
Log:
Did some modifications to Sample files

Modified:
    webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncEchoClient.java
    webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncPingClient.java
    webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncEchoClient.java
    webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncPingClient.java
    webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/service/RMInteropService.java

Modified: webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncEchoClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncEchoClient.java?rev=331140&r1=331139&r2=331140&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncEchoClient.java (original)
+++ webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncEchoClient.java Sun Nov  6 11:05:09 2005
@@ -28,6 +28,7 @@
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
 import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.soap.SOAP12Constants;
 import org.apache.sandesha2.Constants;
 import org.apache.sandesha2.util.SandeshaUtil;
 
@@ -61,9 +62,12 @@
 		
 		Call call = new Call(AXIS2_CLIENT_PATH);
 		call.engageModule(new QName("sandesha"));
+		//call.set(Constants.SANDESHA_DEBUG_MODE,"on");
 		call.set(Constants.AcksTo,acksToEPR); //Optional
+		call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
 		call.setTo(new EndpointReference(toEPR));
 		call.set(Constants.SEQUENCE_KEY,"sequence1");  //Optional
+		call.setSoapAction("test:soap:action");
 		call.set(Constants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Optional
 		call.setTransportInfo(org.apache.axis2.Constants.TRANSPORT_HTTP,org.apache.axis2.Constants.TRANSPORT_HTTP,true);
 		Callback callback1 = new TestCallback ("Callback 1");

Modified: webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncPingClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncPingClient.java?rev=331140&r1=331139&r2=331140&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncPingClient.java (original)
+++ webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/AsyncPingClient.java Sun Nov  6 11:05:09 2005
@@ -25,6 +25,7 @@
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
 import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.soap.SOAP12Constants;
 import org.apache.sandesha2.Constants;
 
 
@@ -58,6 +59,8 @@
 		
 		MessageSender sender = new MessageSender (AXIS2_CLIENT_PATH);
 		sender.set(Constants.AcksTo,acksToEPR);
+		sender.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+		sender.setSoapAction("aaaaa");
 		sender.engageModule(new QName ("sandesha"));
 		sender.setTo(new EndpointReference(toEPR));
 		sender.set(Constants.SEQUENCE_KEY,"sequence1");

Modified: webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncEchoClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncEchoClient.java?rev=331140&r1=331139&r2=331140&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncEchoClient.java (original)
+++ webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncEchoClient.java Sun Nov  6 11:05:09 2005
@@ -28,6 +28,8 @@
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
 import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.soap.SOAP12Constants;
+import org.apache.axis2.soap.SOAPConstants;
 import org.apache.sandesha2.Constants;
 import org.apache.sandesha2.util.SandeshaUtil;
 
@@ -57,6 +59,8 @@
 		call.engageModule(new QName("sandesha"));
 		call.setTo(new EndpointReference(toEPR));
 		call.set(Constants.SEQUENCE_KEY,"sequence1");  //Optional
+		//call.set(Constants.SANDESHA_DEBUG_MODE,"on");
+		call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
 		call.set(Constants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Optional
 		call.setTransportInfo(org.apache.axis2.Constants.TRANSPORT_HTTP,org.apache.axis2.Constants.TRANSPORT_HTTP,true);
 		Callback callback1 = new TestCallback ("Callback 1");

Modified: webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncPingClient.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncPingClient.java?rev=331140&r1=331139&r2=331140&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncPingClient.java (original)
+++ webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/clients/SyncPingClient.java Sun Nov  6 11:05:09 2005
@@ -25,8 +25,12 @@
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMFactory;
 import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.soap.SOAP11Constants;
+import org.apache.axis2.soap.SOAP12Constants;
 import org.apache.sandesha2.Constants;
 
+import com.ibm.wsdl.extensions.soap.SOAPConstants;
+
 public class SyncPingClient {
 
 	private String toIP = "127.0.0.1";
@@ -44,6 +48,7 @@
 	}
 	
 	public void run () throws AxisFault {
+		
 		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
 			System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory.");
 			return;
@@ -51,8 +56,10 @@
 		
 		MessageSender sender = new MessageSender (AXIS2_CLIENT_PATH);
 		sender.engageModule(new QName ("sandesha"));
+		//sender.set(Constants.SANDESHA_DEBUG_MODE,"on");
 		sender.setTo(new EndpointReference(toEPR));
 		sender.set(Constants.SEQUENCE_KEY,"sequence1");
+		sender.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
 		sender.send("ping",getPingOMBlock("ping1"));
 		sender.send("ping",getPingOMBlock("ping2"));
 		sender.set(Constants.LAST_MESSAGE, "true");

Modified: webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/service/RMInteropService.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/service/RMInteropService.java?rev=331140&r1=331139&r2=331140&view=diff
==============================================================================
--- webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/service/RMInteropService.java (original)
+++ webservices/sandesha/trunk/samples/src/org/apache/sandesha2/samples/interop/service/RMInteropService.java Sun Nov  6 11:05:09 2005
@@ -17,7 +17,6 @@
 
 package org.apache.sandesha2.samples.interop.service;
 
-
 import java.util.HashMap;
 import java.util.Map;
 
@@ -33,59 +32,108 @@
 import org.apache.axis2.om.OMNamespace;
 
 /**
- * @author 
- * 
+ * @author  
  */
 public class RMInteropService {
 
-    private static Map sequences = new HashMap();
+	private static Map sequences = new HashMap();
+
+	public OMElement echoString(OMElement in) {
+
+		String responseText = null;
+		if (in != null) {
+			String tempText = in.getText();
+			if (tempText == null || "".equals(tempText)) {
+				OMElement firstChild = in.getFirstElement();
+				if (firstChild != null)
+					tempText = firstChild.getText();
+			}
+
+			if (tempText != null)
+				responseText = tempText;
+		}
+
+		System.out.println("echoString got text:"
+				+ ((null == responseText) ? "" : responseText));
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace omNs = fac.createOMNamespace("http://tempuri.org/",
+				"echoString");
+		OMElement method = fac.createOMElement("echoStringResponse", omNs);
+
+		OMElement value = fac.createOMElement("text", omNs);
+
+		if (responseText == null || "".equals(responseText))
+			responseText = "echo response";
+
+		value.setText(responseText);
+		method.addChild(value);
+
+		return method;
+	}
+
+	public void ping(OMElement in) {
+		//Just accept the message and do some processing
+
+		String text = null;
+		if (in != null) {
+			OMElement firstElement = in.getFirstElement();
+			if (firstElement != null) {
+				text = firstElement.getText();
+			}
+		}
+
+		text = (text == null) ? "" : text;
+
+		System.out.println("Ping got text:" + text);
+	}
+
+	public OMElement EchoString(OMElement in) {
+
+		String responseText = null;
+		if (in != null) {
+			String tempText = in.getText();
+			if (tempText == null || "".equals(tempText)) {
+				OMElement firstChild = in.getFirstElement();
+				if (firstChild != null)
+					tempText = firstChild.getText();
+			}
+
+			if (tempText != null)
+				responseText = tempText;
+		}
+
+		System.out.println("echoString got text:"
+				+ ((null == responseText) ? "" : responseText));
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace omNs = fac.createOMNamespace("http://tempuri.org/",
+				"echoString");
+		OMElement method = fac.createOMElement("echoStringResponse", omNs);
+
+		OMElement value = fac.createOMElement("text", omNs);
+
+		if (responseText == null || "".equals(responseText))
+			responseText = "echo response";
+
+		value.setText(responseText);
+		method.addChild(value);
+
+		return method;
+	}
+
+	public void Ping(OMElement in) {
+		//Just accept the message and do some processing
+
+		String text = null;
+		if (in != null) {
+			OMElement firstElement = in.getFirstElement();
+			if (firstElement != null) {
+				text = firstElement.getText();
+			}
+		}
+
+		text = (text == null) ? "" : text;
+
+		System.out.println("Ping got text:" + text);
+	}
 
-    public OMElement echoString(OMElement in) {
-    	     	
-        String responseText = null;
-        if (in!=null) {
-        	String tempText = in.getText();
-        	if (tempText==null || "".equals(tempText)) {
-        		OMElement firstChild = in.getFirstElement();
-        		if (firstChild!=null)
-        			tempText = firstChild.getText();
-        	}
-        	
-        	if (tempText!=null)
-        		responseText = tempText;
-        }
-        	
-        
-        System.out.println("echoString got text:" + ((null==responseText)?"":responseText));
-        OMFactory fac = OMAbstractFactory.getOMFactory();
-        OMNamespace omNs = fac.createOMNamespace("http://tempuri.org/", "echoString");
-        OMElement method = fac.createOMElement("echoStringResponse", omNs);
-
-        OMElement value = fac.createOMElement("text", omNs);
-        
-        if (responseText==null || "".equals(responseText))
-        	responseText = "echo response";
-        
-        value.setText(responseText);
-        method.addChild(value);
-
-        return method;
-    }
-
-
-    public void ping(OMElement in) {
-        //Just accept the message and do some processing
-
-    	String text = null;
-    	if (in!=null) {
-    		OMElement firstElement= in.getFirstElement();
-    		if (firstElement!=null) {
-    			text = firstElement.getText();
-    		}
-    	}
-    	
-    	text = (text==null)?"":text;
-    	
-    	System.out.println("Ping got text:" + text);
-    }
-}
+}
\ No newline at end of file



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