ࡱ > ~ } [@ , bjbj44 :2 Vi Vi n . . . 8 f 4 , " " 3 3 3 ; F V f $ R Y / 3 ; 5" 5" 5" x 5" 5" 5" " : z , @ Ple . a 0 C V =! \ 3 G 5" U a 3 3 3
" ( 95-702 Organizational Communication and Distributed Object
Technologies Homework 5 Due: Wednesday, May 3, 2006
Lab Topics: Axis Web Services: Request, Session, and Application Scope
Part I. Web Services Request Scope 20 Points
Write a web service using Tomcat and Axis that implements the following two methods:
public BigInteger add(BigInteger x, BigInteger y)
public BigInteger mult(BigInteger x,BigInteger y)
Write a client that reads two BigIntegers from the command line. It will then call the remote method add to compute the sum. It will then call the remote method multiply to compute the produce. The sum and product will be displayed on the clients screen.
Edit the ServiceLocator class (created when you compiled the wsdl document) so that it points to port 6502. Run the TCPMonitor utility with the parameters as shown:
java org.apache.axis.utils.tcpmon 6502 localhost 8080
The idea is to have your client visit port 6502 (where TCPMon is listening) and then have TCPMon pass the request onto your web service. Please see the TCPMonitor documentation provided with your Tomcat/Axis installation.
Submit the Java source code of your web service. 5 Points
Submit the Java source code of your client. 5 Points
Submit screenshots showing your client interacting with a user for multiplication and addition. 5 Points
Submit four SOAP documents. There will be two per method and there are two methods. Copy these from the TCPMonitor display and be sure to show the input and output documents associated with some actual calls to your service. 5 Points
Part II. Web Services Session Scope 30 Points
The exercise in Part 1 you used what has come to be called Request Scope. There is no need for the arithmetic service to maintain state associated with a client. Tomcat/Axis defaults to request scope. In this part you will use session scope to implement a single register machine.
On the server side, session scope is established with the following line in your web service deployment descriptor:
On the client side you will need to execute the following on the locator object:
loc.setMaintainSession(true);
Write a web service using Tomcat and Axis that implements the following two methods:
public void loadAccum(BigInteger x)
public BigInteger readAccum() {
public void add(BigInteger y) {
Write a client that uses the web service to compute the sum 1+2+3+1000. The partial sums should be displayed as the client runs. That is, the output of the client will be 1, 3, 6 , , (1+2+3+1000). Your client must make 1000 calls to the web service.
The idea is to have your web service maintain a single BigInteger that acts as an accumulator. Clients may load a value into it, read a value from it or add to it.
Submit the Java source code of your web service. 10 Points
Submit the Java source code of the client. 10 Points
Submit a screenshot showing your client running and displaying the first 20 values computed. 10 Points
Part III. Web Services Application Scope 50 Points
Chapter 5 of the Coulouris text contains a Java RMI case study. The code implements a distributed white board. Modify the code so that it acts as a distributed chat server. Rather than moving graphical objects about we would like to move simple text. Rather than using Java RMI, use Web Services with application scope.
The execution of one client program follows:
C:>java MyChatClient
client>Hello There
Hello There
This is cool
Hello There
This is cool
Im talking to myself
Hello There
This is cool
Im talking to myself
! Explanation mark means quit
C:> There were no other clients running.
Submit your client source. 20 Points
Submit your server source code. 20 Points
Show a few screen shots showing two or more clients talking. 10 Points
95-733 Organizational Communication and Distributed Object Technologies Homework Carnegie Mellon University
PAGE
PAGE 1
< D R S Z i j u v z ¶§wpcVIVI<