Exercises

The intention of this day is for you to create and use RPC-style Web Services. To ensure that you are comfortable with these areas, you should attempt the following tasks.

  1. Create a simple stock quote server using a JWS file. The stock quote server should take a string as the stock for which a quote is required ("SUNW", "MSFT", "ACME"). The quote service should return a floating point value that reflects the current share price. Your server should just hold two arrays—one of strings and one of associated stock prices (don't get bogged down in the application logic, but feel free to have a bit of fun with the stock prices you return!).

  2. Deploy the service and check that it is operational by obtaining its WSDL.

  3. Create a client for the service using a generated proxy or a ServiceClient. The client should be a simple command-line application that takes a single string that is the name of the stock to retrieve.

  4. Convert your JWS service into a standard service that uses a deployment descriptor. Deploy and test your service.

  5. Alter your client and server so that the value returned is a JavaBean that contains the name of the stock together with its current price and its 90-day high and low values (so basically, a string and three floating point numbers).

    Use a BeanSerializer to marshal and unmarshal your JavaBean. Alter the server's deployment information appropriately. Redeploy the service and test it out.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.188.201