...
What we tried to accomplished was the challenge to model and implement an Amazon-like application running as a Tuscany Application (from now on Shopping Store). Of course, we wanted this application to be fully compatible to the Amazon's WSDL (http://ecs.amazonaws.com/AWSECommerceService/2007-05-14/AWSECommerceService.wsdl). This way, any given (Web) application written to interact with Amazon through its WS interface (e.g. http://www.openlaszlo.org/node/198
) would be seamlessly communicating with the application entirely coded as a Tuscany application.
...
In the particular case of the application which gave birth to this document, the WSDL file was taken from Amazon. It is important to make clear that in its first phase of development the Shopping Store application was intended to provide only a Shopping Cart service, and this document only covers this initial phase. Therefore, since Amazon's WSDL is composed of a lot of different methods/operations it had to be reduced and only the operations related to the Shopping Cart remained. Here you can see the final version of the WSDL file called shoppingstore.wsdl: https://issues.apache.org/jira/secure/attachment/12368949/ShoppingStore.wsdl. It is worth mentioning that the soap address was modified in order for it to point to the location where the Shopping Cart service will be running.
...
First, let us create the following directory structure (this will be a new "project", thus create it in a new location):
- build -> this directory will contain everything needed to generate the jar containing the Shopping Store app.
- wsdl
- shoppingstore.wsdl -> the reduced Amazon WSDL
- shoppingstore.composite -> the content of this file will be explained later
- wsdl
- dist -> this directory will contain everything needed to run the Shopping Store application
- lib -> lib required to compile and run the Shopping Store application
- AWS2007_05_14.jar -> the jar file we have just created
- src -> directory containing the source code of the Shopping Store application (we will be explain it later)
- shoppingstore
- server
- ShoppingStoreServer.java
- services
- cart
- CartService.java
- CartServiceImpl.java
- cart
- server
- shoppingstore
Now, let us specify its interface (which, in this case, will be identical to the skeleton shown before) in a java file named CartService.java:
...
1 - Install Tuscany: Download it (http://cwiki.apache.org/TUSCANY/sca-java-releases.html) and uncompress it on the directory where you want it to be located (e.g. /opt/tuscany-sca-1.0-incubating).
...
3.2 - Now, copy the lib directory (along with the contained AWS2007_05_14.jar file) into the "dist" directory. It must look like this:
-dist
- lib
AWS2007_05_14.jar
shoppingstore.jar
...