Web Services Invocation Framework:
DSL Provider Sample Application

This is a sample application that shows how WSIF lets you write flexible applications through its WSDL-driven, protocol-independent APIs.

The application lets users enter their names and addresses and then tells them whether DSL service is available in their area or not. It stores addresses once entered, so returning users need not reenter that information. It also verifies the validity of addresses.

The application uses three separate pieces of software to do its job:

These three pieces of software are modeled as WSDL-described services. Once we do this, we can then access their functionality using the WSIF API, giving us a consistent view of the functionality being used, and allowing dynamic protocol switching and other WSIF benefits. Our application is programmed against the following abstract service definitions:

Here is the code for our application. It takes as command line arguments the locations of the WSDL files for the three services. Note that we can provide absolutely any WSDL files as long as the abstract definitions match the ones we programed against. In particular, we can define new bindings, move the service endpoints - for example, to a different application server - change client libraries, etc. without affecting the application code in any way.

Above we show the application's view of the services it uses, along with a different view that shows what could really be behind the WSDL service.

Running the application

It is advisable to try running this application after going through the simplesoap, complexsoap, ejb and jms samples.

The simplest way to run this application is to use the provided WSDL files. First, you need to make sure all your services are deployed and available.

The addressbook WSDL describes an EJB binding. To deploy the address book service as an EJB, follow the instructions provided in the EJB sample. Test that your EJB works using the client provided with that sample.

The zip code WSDL describes a SOAP binding. Fortunately this is an external, publicly available web service. To verify that the server is up and the service is running, try out one of the clients in the complexsoap sample.

The availability WSDL describes a JMS binding. To deploy the availability service so that it is accessible via JMS, follow the instructions provided in the JMS sample. Test that your JMS service works using the client provided with that sample.

Once you have all the pieces deployed and you have verified that they work, you can then run this application. You can use the command
java dslprovider.ServiceChecker samples/complexsoap/Zip2Geo.wsdl
samples/ejb/AddressBook.wsdl samples/jms/ServiceAvailability.wsdl

Here is a set of interactions with the application:

Providing an invalid zip code/city combination:


C:\work\xml-axis-wsif\java>java dslprovider.ServiceChecker samples\complexsoap\Zip2Geo.wsdl samples\ejb\AddressBook.wsdl samples\jms\ServiceAvailability.wsdl

************************
WELCOME TO FAST DSL INC.
************************


Interested in DSL service? Enter your address in the form below and we will chec
k whether we have service available in your area.

If you have previously expressed interest, just enter your name (leave other fie
lds blank) and we will look up the rest of the information in our records
Name: Jow Schmoe
Street Number: 20
Street Name: Nowhere Street
City: New York
State: NY
Zip: 47405


Adding address to records...


Verifying validity of address...
Zip 47405 is in city BLOOMINGTON, not city New York as you specified

Providing a valid address, checking for service; then repeating the check for service for the same name with providing address (address provided the first time is stored):


C:\work\xml-axis-wsif\java>java dslprovider.ServiceChecker samples\complexsoap\Zip2Geo.wsdl samples\ejb\AddressBook.wsdl samples\jms\ServiceAvailability.wsdl
************************
WELCOME TO FAST DSL INC.
************************


Interested in DSL service? Enter your address in the form below and we will check whether we have service available in your area.

If you have previously expressed interest, just enter your name (leave other fields blank) and we will look up the rest of the information in our records
Name: Joe Schmoe
Street Number: 20
Street Name: Nowhere Street
City: NEW YORK
State: NY
Zip: 10005


Adding address to records...


Verifying validity of address...


Customer: Joe Schmoe
Address: 20 Nowhere Street, NEW YORK NY 10005
Checking service availability...
No, we do not offer service in your area


Enter 'q' to quit, any other key continue...

************************
WELCOME TO FAST DSL INC.
************************


Interested in DSL service? Enter your address in the form below and we will check whether we have service available in your area.

If you have previously expressed interest, just enter your name (leave other fields blank) and we will look up the rest of the information in our records
Name: Joe Schmoe
Street Number:
Street Name:
City:
State:
Zip:


Looking up address...


Verifying validity of address...


Customer: Joe Schmoe
Address: 20 Nowhere Street, NEW YORK NY 10005
Checking service availability...
No, we do not offer service in your area


Enter 'q' to quit, any other key continue...
q

Doing an invalid address lookup by providing a name not entered before:


C:\work\xml-axis-wsif\java>java dslprovider.ServiceChecker samples\complexsoap\Zip2Geo.wsdl samples\ejb\AddressBook.wsdl samples\jms\ServiceAvailability.wsdl
************************
WELCOME TO FAST DSL INC.
************************


Interested in DSL service? Enter your address in the form below and we will check whether we have service available in your area.

If you have previously expressed interest, just enter your name (leave other fields blank) and we will look up the rest of the information in our records
Name: Jane Schmoe
Street Number:
Street Name:
City:
State:
Zip:


Looking up address...
Address for Jane Schmoe wasn't found

Note: The addressbook service has an EJB binding; in our sample implementation, this is implemented by a session bean, so the conversational state (i.e. the addressbook being modified and queried) is not saved to persistent storage. As a result, in your use of this application, you will notice that if you add an address and then terminate the session, then start another session with the application you start out with an empty address book, i.e. the previous address you entered will not be stored. You can however verify the lookup function by adding an address, then repeating the information with the same name but an empty address. This is not in any way close to a real application it is just a sample that demonstrates how easy it is to tie together JMS, EJBs and SOAP using WSDL as a normalised description of software and WSIF as the programming model.