From 4c2bb0cebb0caff68e32c2f32d9e4e1c0310b33e Mon Sep 17 00:00:00 2001 From: slaws Date: Tue, 20 Apr 2010 18:05:26 +0000 Subject: Add exceptions to the test and make the launchers a bit more generic git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@936018 13f79535-47bb-0310-9956-ffa450edef68 --- .../external/client/HelloWorldClientLauncher.java | 40 ++++++++++++++++++---- .../src/main/resources/HelloWorldImplService.wsdl | 28 +++++++++++++++ .../resources/HelloWorldImplService_schema1.xsd | 24 +++++++++++++ 3 files changed, 85 insertions(+), 7 deletions(-) (limited to 'sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main') diff --git a/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java b/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java index e8574d67e9..da40a7f442 100644 --- a/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java +++ b/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java @@ -25,23 +25,49 @@ import java.net.URL; import javax.xml.namespace.QName; import javax.xml.ws.Service; +import org.apache.tuscany.sca.binding.ws.jaxws.sca.Exception_Exception; import org.apache.tuscany.sca.binding.ws.jaxws.sca.HelloWorldImpl; public class HelloWorldClientLauncher { - public static void main(String[] args) throws Exception { + public HelloWorldImpl wsProxy; + + public HelloWorldClientLauncher(){ + } + + public void createClient() throws Exception{ System.out.println(">>> Starting external JAXWS client "); - + // default JVM JAXWS support QName serviceName = new QName("http://jaxws.ws.binding.sca.tuscany.apache.org/", "HelloWorldImplService"); QName portName = new QName("http://jaxws.ws.binding.sca.tuscany.apache.org/", "HelloWorldImplPort"); //URL wsdlLocation = new File("../external-client/target/classes/helloworld-sca.wsdl").toURL(); URL wsdlLocation = new File("../external-client/target/classes/HelloWorldImplService.wsdl").toURL(); javax.xml.ws.Service webService = Service.create(wsdlLocation, serviceName); - HelloWorldImpl wsProxy = (HelloWorldImpl) webService.getPort(portName, HelloWorldImpl.class); - - String response = wsProxy.getGreetings("Fred"); - - System.out.println("Leaving external JAXWS client: " + response); + wsProxy = (HelloWorldImpl) webService.getPort(portName, HelloWorldImpl.class); + } + + public void destroyClient(){ + System.out.println(">>> Stopping external JAXWS client: "); + // TODO + } + + public String getGreetings(String name){ + System.out.println("Entering External Client HelloWorld.getGreetings: " + name); + String response = wsProxy.getGreetings(name); + System.out.println("Leaving External Client HelloWorld.getGreetings: " + response); + return response; + } + + public String getGreetingsException(String name) throws Exception_Exception { + return wsProxy.getGreetingsException(name); + } + + public static void main(String[] args) throws Exception { + HelloWorldClientLauncher launcher = new HelloWorldClientLauncher(); + launcher.createClient(); + launcher.getGreetings("Fred"); + launcher.destroyClient(); } + } diff --git a/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl b/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl index 8ae67d4270..0d9d17d1be 100644 --- a/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl +++ b/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl @@ -12,6 +12,15 @@ + + + + + + + + + @@ -23,6 +32,11 @@ + + + + + @@ -39,6 +53,18 @@ + + + + + + + + + + + + @@ -56,3 +82,5 @@ + + diff --git a/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd b/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd index 00d526db82..eef9ad4ead 100644 --- a/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd +++ b/sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd @@ -1,14 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3