Assignment #2: Web services


A Web Service is another distributed computing model which could be used to establish application-to-application communication. Unlike RMI (which makes use of the specified JRMP protocol), web services' communication is based on the standard Internet protocols (HTTP) and data format (XML). 

In the second assignment, you will create a simple web service and write an application to consume the web service.

Due date: Tuesday 10.30.2007

Build a Web Service Application


Learning about web services

To get general information about web services, read the Wikipedia web service page.

Download MyEclipse from

MyEclipse is commercial, but free for a test period of 30 days. It contains a web service developing tool which you can use to build your webservice.

Work through the following tutorial making use of the MyEclipse IDE to build and test web services:


You will build a simple webservice called fruit price service.

Fruit service is a web service that keeps a fruit-price table to record the different kinds of fruits' prices. It will supply clients' four services so that clients can add fruit prices, update fruit prices, delete fruit prices or calculate fruit cost.


We give you a service interface definition. Download it here

Use MyEclipse to build the fruit price web service project. In the web service project, write a class to implement the four services defined in the interface.

Use MyEclipse to build another client project. In the client project, write a class to access the four fruit price web services (add fruit price, update fruit price, delete fruit price and calculate fruit cost).

Note: When you install MyEclipse, a MyEclipse Tomcat application server will also be installed. Please make sure to use MyEclipse Tomcat as your application server to test your webservice since we will use this server when we mark the assignments.

Additional Information:

You are only required to test your web service application locally. 

However, we encourage you to test your web service application by running your client application and your web service on different computers. 

What to Hand in

Each student has to send us:

  • the .zip file containing your whole web service project.
  • the .zip file containing your whole client project.

We will test them on our MyEclipse IDE.

Note: In MyEclipse, use 'export'  to save a MyEclipse project into a .zip file.

Due date: 10.30.2007