From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../samples/sca/customerinfo/readme.htm | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 branches/java-post-M1/samples/sca/customerinfo/readme.htm (limited to 'branches/java-post-M1/samples/sca/customerinfo/readme.htm') diff --git a/branches/java-post-M1/samples/sca/customerinfo/readme.htm b/branches/java-post-M1/samples/sca/customerinfo/readme.htm new file mode 100644 index 0000000000..5619733093 --- /dev/null +++ b/branches/java-post-M1/samples/sca/customerinfo/readme.htm @@ -0,0 +1,61 @@ + + + Tuscany +CustomerInfo + + + +

Tuscany CustomerInfo Sample

+ +

Overview

+ +

The CustomerInfo sample shows a component exposing a WSDL portType interface + and a J2SE client using the dynamic SDO API to use the component.

+ +

Location

This +sample is located  in the samples\sca\customerinfo directory.

+ +

Setup

This sample depends on the Tuscany runtime and the sample jar, + + + sample-customerinfo-incubating-M1.jar + + +, both of these must be available on the classpath to run the sample. +
    +
+

Running

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

Results

+

The sample when run should simply display to the standard +output:
+ +customerID = 12345
+firstName = Jane
+lastName = Doe
+

+

Code Overview

+The source files are physically organized as shown below: +
src
+---main
    +---java
    ¦   +---customerinfo
    ¦           CustomerInfoClient.java
    ¦           CustomerInfoServiceImpl.java
    ¦
    +---resources
            sca.module
    +---wsdl
            customer.xsd
            customerinfo.wsdl
+
+ + + + + + +
sca.moduleDefines the SCA module and component. Defines for the +CustomerInfoServiceComponent component with the Java class that +implements that component
CustomerInfoServiceImpl.javaImplements the SCA component. Uses an @SDOHelper anotation to have the SDO DataFactory automatically injected into the dataFacory field, and uses the DataFactory to create a cutomer DataObject which it initialises and returns to the caller.
CustomerInfoClient .javaCreates a Tuscany runtime and starts it.  Obtains +the module context which was defined by the sca.module file. From the +module context locates the CustomerInfoServiceComponent, and then +calls  the getCustomerInfo method to invoke the component. It uses the SDO dynamic APIs to extract the information from the returned DataObject.

\ No newline at end of file -- cgit v1.2.3