Tuscany Hello World Celtix Web service Sample

Overview

The Tuscany hello world Celtix Web service sample shows using the Tuscany SCA runtime as a standalone web service.

Location

This sample is located  in the samples\sca\helloworldws-celtix directory.

Setup

This sample depends on the Tuscany runtime, Celtix, and the sample jar, sample-helloworldws-celtix-incubating-M1.jar , all of these must be available on the classpath to run the sample.

Running

In the directory samples/sca/helloworldws-celtix use the JDK 1.5 java command to run the class helloworld.HelloWorldServer
Linux: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar:../../../lib/celtix/tuscany-celtix-incubating-M1.jar:target/sample-helloworldws-celtix-incubating-M1.jar helloworld.HelloWorldServer
Windows: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar;../../../lib/celtix/tuscany-celtix-incubating-M1.jar;target/sample-helloworldws-celtix-incubating-M1.jar helloworld.HelloWorldServer

Code Overview

The source files are physically organized as shown below:
   +---main
   +---java
   ¦   +---helloworld
   ¦           HelloWorldServer.java
   ¦           HelloWorldImpl.java
   ¦           HelloWorldService.java
   +---resources
     ¦   sca.module
     +---wsdl
            helloworld.wsdl 
                


HelloWorldServer.java Main method to startup the Tuscany runtime which will startup the services defined in sca.module
HelloWorldService.java Defines the Java interface implemented by the component.
HelloWorldImpl.java Implements the SCA component. Uses the SCA service annotation tag on the class to show what SCA interface is being implemented.
sca.module Defines the SCA module, entryPoint and component. Defines for the HelloWorldServiceComponent component and the Java class that implements the component For the entryPoint it defines WSDL for the service, the Java interface provided by the service, and wires the service to the HelloWorldServiceComponent
helloworld.wsdl WSDL for the service.