The Tuscany hello world WS client sample shows using the Tuscany SCA runtime in a J2SE environment invoking a web service.
Linux: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar:../../../lib/axis2/tuscany-axis2-incubating-M1.jar:target/sample-helloworldwsclient-incubating-M1.jar helloworld.HelloWorldClient
Windows: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar;../../../lib/axis2/tuscany-axis2-incubating-M1.jar;target/sample-helloworldwsclient-incubating-M1.jar helloworld.HelloWorldClientNote: In the above classpaths, you can replace axis2/tuscany-axis2-incubating-M1.jar with celtix/tuscany-celtix-incubating-M1.jar to use Celtix as the underlying webservices implementation.
The sample when run should simply display to the standard
output:
Hello World
src |
sca.module | Defines the SCA module, externalService and component. Defines for the HelloWorldServiceComponent component and the Java class that implements the component For the externalService it defines WSDL for the service, the Java interface provided by the service. The the HelloWorldServiceComponent is via a referenced wired to the externalService |
HelloWorldClient.java | Creates a Tuscany runtime and starts it. Obtains the module context which was defined by the sca.module file. From the module context locates the HelloWorldService entryPoint and then calls the getGreetings method to invoke the web service defined in the helloword.wsdl. |
HelloWorldService.java | Defines the Java interface implemented by the component. |
helloworld.wsdl | WSDL for the service. |