CSE 5306 Lab # 3 spring 2009

Online Airline Reservation using Web Services

Objectives:

1.  Exposure to Web Services

2.  Using Java’s Web Services Development Pack, in particular, JAX-RPC and SAAJ API’s.

3.  Using a Web Container (like Tomcat) to deploy your application.

4.  Understanding the essential components of Web Services

a.)  SOAP (Simple Object Access Protocol)

b.)  WSDL (Web Services Description Language)

c.)  UDDI (Universal Description, Discovery & Integration Language)

Due: April 29, 2009 11:59:59 pm

Project Specification:

In this lab you will be developing an Online Airline Reservation System. This lab consists of three parts as shown in figure 1. Each of these parts corresponds to a business process from a different company.

Figure 1. Project Overview.

Credit Card Company

You will design a system for a Credit Card Company. This system will use Web Services to provide the following services:

1.  Authenticate the vendor (Travel Agent)

2.  Authorize a transaction, and if approved, to charge the customer

You will need to maintain a list of authorized vendors and their passwords to facilitate authentication and also a list of credit card customers by name and their credit card information (Credit Card #, Expiration Date, Available Credit) to authorize a transaction. You should store this information in a file or a database. As a customer of the travel agency charges flights you should update the Available Credit in the file.

Airline Company

You will also design a system for an airline which will make their reservation system available as a web service to selected vendors (travel agencies). The system should allow the following services:

1.  Provide information about the flights (Flight #, Date, Time, Departing City, Destination City, Seats available).

2.  Facilitate the actual Reservation

As previously, you should store information about flights in a file or a database. As with the available credit, as tickets are booked you should update the number of seats available in the files.

Travel Agent

The Travel Agent is the consumer of the web services provided by the Credit Card and the Airline Company. The Travel Agent has a web site that takes care of booking flights, hotels and car rentals. To keep the lab simple, assume that the car rental and hotel reservations are already implemented. You do not have to show these in your lab. The Travel Agent does the following to support flight booking:

1.  Displaying the flight information retrieved from the Airline Company so the user can make a selection.

2.  Charge the user’s Credit Card for the reservation amount using Credit Card Company’s web services.

3.  Notify the Airline Company about the reservation.

The Travel Agent website should be accessed by multiple clients at the same time. The website should have sufficient functionality to properly display the flight information and to take user details for flight reservation. Also, you need to have a facility whereby a user can specify the number of seats he wants to reserve in a flight he is booking.

Other Specifications

1.  The project should be developed using Java Web Services Developer Pack which can be downloaded from Java’s Website for free (See References).

2.  The communication between the Travel Agent and the Credit Card Company should be using the SAAJ (SOAP with Attachments API for Java) API.

3.  The communication between the Travel Agent and the Airline Company should be done using the JAX-RPC (Java API for XML-based RPC) API’s.

4.  Adhere to the directory structure for the source (and other) files used by your Web Container (e.g. Tomcat). This structure is specified below in the Submission Guidelines. Following this structure will simplify grading for the TA.

5.  Use meaningful names for your classes and variable in your programs.

6.  Your submission should follow the instruction given in the ‘Submission Guidelines’ section.

Note

For the Ant Tool and other API’s in the JWSDP 2.0 to run correctly you need to include the following two paths in your ‘PATH’ system variable

C:\jwsdp-2.0\apache-ant\bin;C:\jwsdp-2.0\jwsdp-shared\bin;

At a command prompt you can use the following command to set the PATH:

set PATH= C:\jwsdp-2.0\apache-ant\bin;C:\jwsdp-2.0\jwsdp-shared\bin;

Also, note that if you have installed the JWSDP 2.0 to any other directory than C:\ then you must modify the above command appropriately.

References:

1.  http://java.sun.com/webservices/docs/2.0/tutorial/doc/index.html (Java’s Web Service Tutorial)

2.  http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html (Developing Web Application using Tomcat (Directory Structure Information))

3.  http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/web.xml.txt (Syntax information for the Web deployment descriptor file (web.xml))

4.  http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt (Syntax for the build for the Ant tool to build and deploy your application (build.xml))

5.  http://java.sun.com/j2ee/1.6/docs/api/ (API’s)

6.  http://java.sun.com/webservices/downloads/previous/(Download site for Java’s Web Service Developer Pack 2.0)

7.  http://www.w3.org/TR/SOAP/ (Information on SOAP Protocol)

8.  http://www.w3.org/TR/wsdl (Information on WSDL)

9.  http://www.uddi.org/ (Information on UDDI)

Writeup:

Your write-up should include instructions on how to compile and run your program. Ideally it should be complete enough that the TA can test your program without your being there. Your writeup should include any known bugs and limitations in your programs. If you made any assumptions such as limits on file sizes you should document what you decided and why. This writeup should be in text format and should be submitted along with your code. If you used any code that you found on the Internet or in a book then the write-up should give a reference to the source.

Submission Guidelines:

You project should be developed with the following directory structure:

Lab3

|----- CCCS (Credit Card Company Service)

|----- ACS (Airline Company Service)

|----- TAP (Travel Agent Portal)

|----- Common Files

Note: you can change the names of the folders if you like.

You should have a folder having the required files in each directory for each of the three services described in the Project Specification. Any configuration files shared between these 3 folders can be placed in the folder (Lab3) containing these folders. You should zip the content in the outer folder (Lab3) and all subfolders. Send it to the email address of class TA, Mr. Apurv Dhadphale (). The name of this file should be your campus login_ID.zip. Be sure that you include everything necessary to unzip this file on another machine and compile and run it. This might include forms, modules, classes, config. files, etc. DO NOT INCLUDE ANY RUNNABLE EXECUTABLE (binary) program. The email servers have limited storage space & we will be recompiling your programs anyway.

Make sure your name and your student ID are listed in your writeup, and in comments in your source code. You may resubmit the project at any time. Late submissions will be accepted at a penalty of 10 points per day. This penalty will apply regardless of whether you have other excuses. In other words, it may pay you to submit this project early. If the TA can not run your program based on the information in your writeup then he will email you to schedule a demo. The TA may optionally decide to require all students to demonstrate their labs. In that case we will announce it to the class.

If your program is not working by the deadline, send it anyway and review it with the TA for partial credit. Do not take a zero or excessive late penalties just because it isn't working yet. We will make an effort to grade you on the work you have done.

Grading:

Points – Element

10 – Credit Card Service works correctly

10 – Airline Company Service works correctly

10 – Travel Agent’s Website has all the required functionality

15 – Travel Agent works correctly

15 – Correct use of the SAAJ API

15 – Correct use of the JAX-RPC API

10 – Adhere to the correct directory structure for source files

10 – Correct Script files to build and deploy the Services on the Web Container

05 – Comments in code

To receive full credit for comments in the code you should have brief headers at the start of every module/ subroutine/ function explaining the inputs, outputs and function of the module. To a large extent VB modules are standardized and self explanatory so that more elaborate headers are not necessary. You should have a comment on every data item explaining what it is about. (Almost) every line of code should have a comment explaining what is going on. A comment such as /* Add 1 to counter */ will not be sufficient. The comment should explain what is being counted.

Deductions for failing to follow directions:

-10 Not submitting in the required directory format.

-2 Including absolute/ binary/ executable module in submission

-2 Submitting writeup in other than plain ASCII text format

-2 Submitted file has a name other than student's campus Login_Id.zip


Important Note:

You may discuss the problem definition and tools with other students. You may discuss the lab requirements. You may discuss or share project designs. All coding work must be your own. You may use any book, WWW reference or other people’s programs (but not those of other students in the class) as a reference as long as you cite that reference in the comments. If you use parts of other programs YOU MUST CITE THOSE REFERENCES. If we detect that portions of your program match portions of any other student’s program it will be presumed that you have collaborated unless you both cite some other source for the code. You must not violate UTA, state of Texas or US laws or professional ethics. Any violations, however small, will not be tolerated. Students who do not submit anything get a grade of 0. Therefore students who break the rules will receive a negative grade – most likely a -50 on this lab assignment.