The CustomerInfo sample shows a component exposing a WSDL portType interface and a J2SE client using the dynamic SDO API to use the component.
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
The sample when run should simply display to the standard
output:
customerID = 12345
firstName = Jane
lastName = Doe
src +---main +---java ¦ +---customerinfo ¦ CustomerInfoClient.java ¦ CustomerInfoServiceImpl.java ¦ +---resources sca.module +---wsdl customer.xsd customerinfo.wsdl |
sca.module | Defines the SCA module and component. Defines for the CustomerInfoServiceComponent component with the Java class that implements that component |
CustomerInfoServiceImpl.java | Implements 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 .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 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. |