Applikationsprogrammering i Java, HT-08 logotype

Assignment 3

Due: 2008-12-10, 8:15

The assignment shall be solved individually or in groups of maximum 2 students.

The purpose of this assignment is to introduce the students to Web Services development and use of Web Services as a means of inter-process communication (IPC). In assignment solutions, students shall demonstrate how to construct a Web Service that stores and reads high-score data for a simplistic computer game, and address how to use this feature in a game implementation. The assignment aims to introduce students to SOAP Web Service development in preparation for the course project and future programming tasks.

In this assignment, you will construct a Web Service and (a set of) Web Service client(s) that provide a simple, loosely coupled solution for a distributed high-score management.

Your web service will provide functionality for

  • storing a score
  • retrieving a list of high-scores
The definition of a score is a tuple of username, date, and score. For this assignment, all of these (including score) will be represented as String, and it is up to you to make sure that the client and server handles the scores in a consistent way.

In this assignment, you need not address dynamic service discovery or any other dynamic SOA techniques, it is recommended you focus on the service implementation.

Your assignment solution will be graded on a scale of U (fail), G (pass) (final grade). You will be able to receive a maximum of 5 points for the final grading of the assignment part of the course. A passing grade on this assignment is required to pass the course.

For your convenience, we have implemented both a service and a client that uses the specified interface. You can find the service at http://nemi.cs.umu.se:8080/axis2/services/HighScoreService, and the client at http://nemi.cs.umu.se:8080/danielh/. Use these components when testing your own solutions. These might not be perfect, so feel free to report any odd behavior.

Development Environment

See the development environment information and the SOAP Web Service Tutorial for information on SOAP Web Service development.

We recommend you to use Linux / UNIX (or possibly newer versions of Mac OS) when working with this assignment, since the development environment is based on this.

Getting Started

For this assignment, you are supplied with a skeleton project that contains the basic structure that you need. This includes build files, directory structures, and a complete WSDL that provides the interface for your service, and is to be used in the same manner as the HelloWorld example of the tutorial. Extract these files into your env/5dv085/ folder, to make use of the supplied build files.

Once you have the archive, go to the directory type 'ant' to compile the files. This will also generate stub classes from the supplied WSDL file. You should use these classes when implementing your solution.

The things that you should do are;

  • Implement a client that calls your service.
  • Implement the service
  • (Optional: Implement a JSP based interface for your client)
To find out how to do this, take a close look at the HelloWorld example that was provided for the tutorial (this is especially true for the Client side). We recommend you to start with the client, and use the existing server to try it out. We also recommend you to look at the 'greet-linux.sh' script file in the example, and adapt this to use your client instead. The solution skeleton includes two scripts (and matching client skeletons), but you are of course free to implement your own client solution instead of building on these should you want to do so.

For the server side, you will have to extend the stub code that you generated before. This file is called HelloWorldServiceSkeleton and is located in the src/se/umu/cs/edu/jap/highscoreservice/stubs directory. Your task is to implement the store() and retrieve() methods to do the actual storing and retrieving of high score records.

When you make changes, use ant to recompile and run the deploy script (e.g. 'deploy-linux.sh') to copy your service to the service container. Don't forget to run the update script (e.g., 'update-linux.sh') to restart the service container.

If you want to know whats going on in greater depth, there is a file called catalina.out in the apache-tomcat/logs directory that contains the service container logs. Use the linux command 'tail -f catalina.out' in a terminal to see what is going on in the container. Note that two errors related to a faulty keystore are expected, and do not affect the assignment.

Since Tomcat is a Web server, you can also use your normal browser to see what services are running. Just point your browser to http://<servername>:<port>/axis2/services/listServices.

For advanced students, we recommend you to try using JSP. Since you already should have the completed clients by now, you can use these to call your service. This means that the only thing you have to do in JSP is calling your clients. There are some great guides on how to get started with JSP, so just google for one. The developing environment supports this out of the box, so you should not have to worry too much about setting it up.

If you want to develop JSP, pay special attention to the list of files and directories on the page explaining the container, as this list explains the existing files and also tells you where all your different files should be placed.

Examination

Place all files pertaining to your solution (including your service .AAR files) in

~/edu/apjava/lab3/

Source code should be placed in

~/edu/apjava/lab3/src/

You assignment report should be placed in

~/edu/apjava/lab3/report/

Due date

2008-12-10, 8:15

Senast uppdaterad 2008-12-02 13:09
/kurser/5DV085/HT08/assignments/3/index.html