Test the Book Web Service Provider

Provides instructions and the code required to send a JSON GET request to test the Book Web service provider.

Now that you have your Web service provider running with all of its resources active, you are ready to interact with the Web service. You can do this using any JSON requester tool.

  1. Create a JSON request with the following endpoint URL:
    http://localhost:5639/cics/services/BookREST/1111
  2. Set the Method to GET.

    You should receive the following JSON response:

    {"book": {"lnk_b_details": {
       "lnk_b_text_details":    {
          "lnk_b_title": "LORD OF THE RINGS",
          "lnk_b_type": "FANTASY",
          "lnk_b_author": "TOLKIEN"
       },
       "lnk_b_stockno": "1111",
       "lnk_b_retail": 15,
       "lnk_b_onhand": 4000,
       "lnk_b_sold": 3444
    }}}
  3. Set the Method to PUT and remove the last five characters from the endpoint URL, so that it now reads:
    http://localhost:5639/cics/services/BookREST
  4. Enter the following JSON request and send it to create a new Book record:
    {"book": {"lnk_b_details": {
       "lnk_b_text_details":    {
          "lnk_b_title": "HARRY POTTER",
          "lnk_b_type": "FANTASY",
          "lnk_b_author": "ROWLING"
       },
       "lnk_b_stockno": "5555",
       "lnk_b_retail": 20,
       "lnk_b_onhand": 6000,
       "lnk_b_sold": 4555
    }}}

    You should receive a response of 00 to show that the record has been added successfully.

  5. Set the Method to GET again and add /5555 to the endpoint URL.

    You should receive a response that matches the JSON you sent in the PUT request.

This concludes the tutorial.