You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ja...@apache.org on 2005/07/14 09:36:47 UTC

svn commit: r219005 - in /webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client: ./ CallTesting.java

Author: jayachandra
Date: Thu Jul 14 00:36:47 2005
New Revision: 219005

URL: http://svn.apache.org/viewcvs?rev=219005&view=rev
Log:
This test case is the tailored working test case that tests the basic integration of call.invoke with underlying Axis2 implementation. This is observed to pass fine on my machine.

Added:
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java?rev=219005&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java Thu Jul 14 00:36:47 2005
@@ -0,0 +1,57 @@
+package org.apache.axis.jaxrpc.client;
+
+//import java.net.URL;
+
+
+import java.io.BufferedOutputStream;
+import java.io.OutputStream;
+import java.io.FileOutputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ParameterMode;
+//import javax.xml.rpc.ServiceFactory;
+
+import org.apache.axis.jaxrpc.client.ServiceImpl;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMOutput;
+
+import junit.framework.TestCase;
+
+public class CallTesting extends TestCase {
+
+	public static void main(String[] args) {
+	}
+
+	public CallTesting(String name) {
+		super(name);
+	}
+
+	public void testInvoke1() {
+		try {
+
+			Service s = new ServiceImpl();
+			Call call = s.createCall();
+			call.setOperationName(new QName("http://testingURL.org/","EchoString"));
+			call.setTargetEndpointAddress("http://localhost:9090/axis/services/Echo");
+			call.addParameter("param1", new QName("http://www.w3.org/2001/XMLSchema","any"), java.lang.Object.class, ParameterMode.IN);
+			call.setReturnType(new QName("http://www.w3.org/2001/XMLSchema","any"), Object.class);
+			Object[] inParams = new Object[]{"hello World!"};
+			OMElement response = (OMElement)call.invoke(inParams);
+
+			try {
+				OutputStream fos = new BufferedOutputStream(System.out);
+				OMOutput otpt = new OMOutput(fos, false);
+				response.serialize(otpt);
+				fos.flush();
+				otpt.flush();
+				} catch (Exception e){}
+
+		} catch (Exception e) {
+			System.out.println(e.getMessage());
+			fail(e.getMessage());
+		}
+	}
+}