CMPUT 410: Web-Based Information Systems

Assignment 6

CMPUT 410 (Fall 2004)

Due Date (by e-mail): November 22th, 2004 (16:59)
Percentage overall grade: 5%
Penalties: 20% off a day for late assignments after November 22th at 16:59pm
Maximum Marks: 10

Objectives

  1. Get familiar with Web Services
  2. Hands-on experience with servlet programming
  3. Use of XML for information exchange
  4. Prepare for your term project

You are asked to implement a small application using web services. A client application would send a request (query) to a server application (web service) in XML and receive the answer in XML. A user interfaces with the client application via a browser. A simple HTML form is used to enter a query, basically a price range, requesting a list of hotels offering rooms in the given price range. A Java servlet would receive the form data and submit a request in XML to another Java servlet playing the role of the web service. This second servlet accesses a database of hotels. The answer is sent in XML to the first servlet which in turn generates a web page with the list of hotels.

Basically, you need to have two java servlets: one receiving the query from a browser and generating a list of hotels in a table, and the second one accessing a database. The first servlet has no database but communicates with the second sevlets via web services. There is only one service required: GetHotelByPrice will query for the hotel list in the database with certain price specifications.

The hotel list with the prices can be found in this XML file. Use this file to populate your database. The web service is described by this WSDL.

This application is a very simple version of your Hotel search capability for the term project. The data flow is as follows:

Data flow for the application

First, you should implement a simple form that allows to enter the price range. The interface should look like the following:
Example Assignment 6
JavaScript should be used to validate the input price. Note that you have to use a DBMS for the second servlet to store the hotel data for this assignment. You should use ORACLE in the lab, help information can be found in lab exercises here and here.

After the client servlet receives the web service response, it should generate a table to show the hotels. An example for price range $100-$200 can be see below:
Result Table
You do not need to have more information for the hotels. If there is no hotels to answer a query, you should display a message rather than a simple blank table.

IMPORTANT:

Remember that the esthetics are not important in this assignment. Functionality is important.

Deliverables

This assignment is to be submitted via email to your TA. Send only one tar file that contains all that you are submitting.
How to create your tar file:
  1. Create a directory, and name it the same as your unix id.
  2. Put all assignment related files into that directory.
  3. tar and zip the directory into a .tgz file (tar zcvf ...). Send that .tgz file to your TA.
What you need to submit:
  • One URL linking to on-line running application with the server and client functionality as described.
  • All the files, The executable and source files, needed for the on-line running applications with the functionality as described, separated nicely in two directories for server and the client.

HOME     Activities