diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-20 18:05:26 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-20 18:05:26 +0000 |
commit | 4c2bb0cebb0caff68e32c2f32d9e4e1c0310b33e (patch) | |
tree | 0217eebf7a156409f84a220b817c89e6c3830ef2 /sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external | |
parent | f6ff505e5bbfe699127f5c468562b4609b8c0f41 (diff) |
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
Diffstat (limited to 'sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external')
-rw-r--r-- | sca-java-2.x/trunk/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java | 40 |
1 files changed, 33 insertions, 7 deletions
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(); } + } |