Tuscany Hello World JS WS Client Sample

Overview

The Tuscany hello world JS client WS sample shows using the Tuscany SCA runtime in a Tomcat environment providing a client for the Tuscany helloworld WS samples, helloworldws and helloworlde4xws.

Location

This sample is located in the samples\sca\helloworldjsclient directory.

Setup

Set up your server as described in the Tomcat Setup.  If you are not configuring with the acceptance test the server, you will need to add sample-helloworldjsclient-incubating-M1.war to your Tomcat's webapp directory.

Running

Once you've started your web server, use your browse to view the following URL: http://localhost:8080/sample-helloworldjsclient/

Code Overview

The source files are physically organized as shown below:
+---main
+---resources
¦ ¦ sca.module
¦ ¦
¦ +---wsdl
¦ helloworld.wsdl
¦
+---webapp
¦ HelloWorldClient.html
¦
+---WEB-INF
web.xml


sca.module Defines the SCA module, and entryPoints which are wired directly to externalServices for each of the web services.
helloworld.wsdl WSDL for the service.
HelloWorldClient.html The HTML page for the client. This includes a JavaScript script which uses the SCA JSON-RPC support to invoke methods on the SCA entryPoints.
web.xml Standard J2EE web application's web.xml

There isn't much code in this sample, only the script in the HTML for the page, and even that script is fairly simple. It demonstrates how simple SCA and its assembly model can make component implementations.