next up previous contents
Next: 6 JOTM-BTP architecture Up: JOTM-BTP: a BTP extension Previous: 4 Ant commands   Contents


5 BTP Demonstration

Once you have a distribution of JOTM-BTP, one handy way to be sure that it is working is to run the demonstration (which is in the demo/ directory of the distribution).

5.1 Scenario

The BTP demonstration is based on a common transaction example: a travel agency which books both one hotel and one flight in the same transaction.
The demonstration is composed of 3 Web services:

The TravelAgency will contact both HotelReservation and FlightReservation to book them in the same transaction. If a problem occurs (such as no more place in the hotel or in the flight), the transaction will be rolled back for both. Otherwise, a reservation will be kept for both of them under the same transaction ID.

In addition to the travel agency client, there are two other servlets which can be used to supervise SOAP messages, transaction messages, hotel and flight reservation,...

5.2 Installation

Before installing the demonstration, you'll need to have a correct installation of both Tomcat and Axis (see Prerequisites).

5.2.1 JOTM and JOTM-BTP

First, copy into $CATALINA_HOME/webapps/axis/WEB-INF/lib/ directory:

5.3 Deployment

Still into $CATALINA_HOME/webapps/axis/WEB-INF/lib/ directory, copy: Copy into $CATALINA_HOME/webapps/axis/:

5.3.1 Web Services deployment

You can find in the demo/ directory 2 .wsdd files (deploy.wsdd and undeploy.wsdd).
deploy.wsdd (resp. undeploy.wsdd) is used to deploy (resp. undeploy) our Demonstration Web Service into Axis.

To deploy, in the demo/ directory, type:

 $ java org.apache.axis.client.AdminClient deploy.wsdd
See Axis documentation to set the CLASSPATH before deploying (so you can find the AdminClient class).

After deployment, start Tomcat and browse at http://localhost:8080/axis/ to check for the deployment status (3 web services, respectively called TravelAgency, HotelReservation and FlightReservation should be deployed).

5.3.2 web.xml modification

The last step is to modify axis/WEB-INF/web.xml file to add description of our demonstration servlets: Finally restart Tomcat (to take into account our new servlets).

5.4 Run the demonstration

Start at the url: http://localhost:8080/axis/btp.html. This page will give you 3 links

You can first book a flight and a hotel using the TravelAgencyServlet, then look at what happens at both the transaction coordinator level (SuperiorServlet ) and transaction participants level (ParticipantServlet) during the booking process.

To simulate a transaction failure, check the Transaction failure simulation... box in the TravelAgencyServlet home page (will cause one of the participants to reject the "prepare" call, then the decider will cancel both participants).

5.5 From CVS

Since all these tasks are really tedious, if you're using CVS version of JOTM-BTP, there is a simpler way to do.
In jotm-btp/ directory, type:

 $ ant demo.jar
 $ ant demo.copy
It will create the btp-demo.jar jar files and copy all the needed jars in axis/WEB-INF/lib/ directory.

Then, you still have to manually insert content of demo/btp-web.xml into axis/WEB-INF/web.xml.

Start Tomcat.

In jotm-btp/ directory, type:

 $ ant demo.deploy
That's it!
You can now try the demonstration from http://localhost:8080/axis/btp.html.

next up previous contents
Next: 6 JOTM-BTP architecture Up: JOTM-BTP: a BTP extension Previous: 4 Ant commands   Contents
Jeff Mesnil 2003-05-15