The Web Services Business Activity (WS-BA) technology for WebSphere® Application Server
enables support for the implementation of web services that follow
the WS-BA specifications.
Time required to set up and configure this sample
1
hour
Prerequisites for use
- WebSphere Application
Server Version 8.0 or Version 8.5 with a profile containing a single
stand-alone application server.
- The procedure in this topic contains instructions for Windows platforms only. To run this sample
on a UNIX platform complete
the following actions when completing this task:
- Substitute the Windows batch
file (.bat) file extension with the UNIX shell script (.sh) file
extension.
- Substitute Windows path
names with the appropriate, fully qualified, UNIX path names. For example, replace \,
used in Windows, with /,
used in UNIX.
Important: This sample was tested with WebSphere Application Server
Version 8.0 or Version 8.5.
Sample download
To use the sample, download
the Web Services Business Activity sample files from a product download
site:
- Choose one of the following methods to download the WSBASample.zip file
to a directory on your workstation: FTP or HTTP.
You might create the /samples/WSBASample directory
path on your workstation and download the Web Services Business Activity
sample files to that directory path.
- From the displayed dialog, specify the target directory to which
to save the compressed file and click OK.
- The WSBASample.zip file contains sample files
in the following directory structure:
/WSBASample
/docs
/images
/installableApps
/scripts
/src
/style
readme.html
Attention: The readme.html file
contains information for installing and running the sample.
Sample description
There is one basic scenario
and one intermediate scenario in this sample.
- Basic Scenario
The basic scenario demonstrates how WS-BA compensation handling
can be used to generate an email notification when an email fails
to be delivered due to a business exception error. You have the option
to cause an exception error in order to test the configuration.
- Intermediate Scenario
The intermediate scenario demonstrates how WS-BA compensation
handling can be used when a process carries out two transactions.
The
first transaction is booking a flight. There are two service providers
for this transaction:
- Flight Provider A
- Flight Provider B
If Flight Provider A returns an error, WS-BA compensation handling
attempts to complete the booking by using Flight Provider B. If both
Flight Providers return an error, a cancelation e-mail is generated.
The
second transaction is booking a hotel. There are two service providers
for this transaction:
- Hotel Provider A
- Hotel Provider B
If Hotel Provider A returns an error, WS-BA compensation handling
attempts to complete the booking by using Hotel Provider B. If both
Hotel Providers return an error, a cancelation e-mail is generated.
When
both booking transactions are complete, the travel agent can decide
not to confirm the booking. In this case the transactions are rolled
back and cancelation emails are generated for each booking.
There
are four pre-configured setups and one custom setup for you to test:
- Preconfigured setup A
- In this setup Flight Provider A is unable to process the booking
request. Instead, the application books the flight with Flight Provider
B. It then books the hotel successfully with Hotel Provider A. This
test shows how WS-BA support overcomes minor failure during transaction
processing, by finding an alternative service provider when the first
service provider has failed.
- Preconfigured setup B
- In this setup Flight Provider A produces an exception error, so
the application books the flight with Flight Provider B. Hotel Provider
A produces an exception error, so the application books the hotel
with Hotel Provider B. This test shows how WS-BA support overcomes
a minor failure during a business activity, by finding an alternative
provider for booking the hotel, despite the fact that one transaction
(booking the flight) has already been completed.
- Preconfigured setup C
- In this setup both flight providers and both hotel providers return
errors and no transactions are completed. The application generates
two cancelation emails detailing that no flight or hotel were booked.
This setup shows the compensation handling aspect of WS-BA. When a
transaction fails, the application compensates by generating a cancelation
email, which can warn the appropriate person about the error.
- Preconfigured setup D
- In this setup, the application successfully books a flight with
Flight Provider A and a hotel room with Hotel Provider A. However,
the travel agent decides not to confirm the bookings, so the transactions
are rolled back. The WS_BA compensation service cancels the flight
and hotel bookings and generates two cancelation emails. This setup
shows how WS-BA compensation handling can be used to roll back the
work completed under two transactions after an input from an external
source.
- Custom configuration
- In the custom configuration you can choose what parts of the system,
if any, produce an error. The user can also choose whether the travel
agent confirms the booking or not. You can test their configuration
and see how WS-BA compensates for any errors that occur.