Testing the sample

When you created the Web service, one of the instructions was to request that a sample be generated. Because that option was selected, the Web Services wizard created a new project with test pages that you can use to test the Web service. In the Navigator view, note that this new project name is Project514Client. Also note that the tool automatically opened TestClient.jsp on the right side of the workbench. This file is located under Project514Client > Web Content > sample > InventoryServices.

To test the sample:

  1. In the loaded page, scroll down the methods pane until you are at the very bottom. Click the Inventory (java.math.BigDecimal) method.
  2. In the itemno field, enter 4 and click Invoke.
  3. Verify that the output returned is:
    result:
    cost: 12.99
    

    This screen capture shows the application with a sample item number 4 entered, with the result cost as $12.99.

Once you confirm the result, you are finished the module! You have created a Web service that returns product prices in the application interface.


[ Top of Page | Previous Page | Next Page | Table of Contents ]