Test the stock query service

Test the stock query service by using curl to send an HTTP request to invoke the service.

Before you begin

zosConnect-2.0 Applies to zosConnect-2.0.

Ensure that the following tasks are complete:

Procedure

  1. Enter the following command to query the state of the stock item with ID 2033.
    Replace host and port with values that are appropriate for your z/OS Connect server.
    curl -i -k -X POST http://host:port/zosConnect/services/stockQuery?action=invoke --data "{\"STOCKQRYOperation\": { \"sqreq\": { \"item_id\": 2033 }}}" -H "Content-Type:application/json"
  2. Check the response.
    An HTTP response code of 200 is expected with the following response.
    {"STOCKQRYOperationResponse":{"sqresp":{"item_count":500,"item_cost":4,"item_desc":"A description.","item_id":2033}}}
    

Results

You successfully used REST to communicate to the stock query application by using the stock query service that is running in z/OS Connect.

What to do next

Follow the steps in Create an API to invoke the IBM MQ stock query service.