Test the IMS database service

You can test your newly created IVP database service is working in z/OS® Connect API toolkit by using the "Try it out!" function in the Swagger UI, or alternatively with a REST client.

Procedure

To test your newly created and deployed IVP database API from within the API Toolkit, take the following steps:

  1. Start IMS and ensure that IMS Connect is listening on the expected port.
  2. Start your IBM® z/OS Connect server. For more information, see Starting and stopping IBM z/OS Connect.
    1. Check the messages.log file for the following messages that confirm that the service is installed.
          BAQR7043I: z/OS Connect service archive dbPhonebook installed successfully.    
      
    2. Check the messages.log file for the following messages that confirm that the API is installed.
          BAQR7000I: z/OS Connect API archive file dbcontacts installed successfully.
      
  3. In the z/OS Connect Servers view under the APIs folder, double-click on the IMS database API.
    The API is opened in the Swagger UI.
  4. Click List Operations to see available operations in the API.
    Figure 1. Operations in the API
    List of operations in the API.
  5. Test querying a contact record by clicking GET.
    1. The Example Value box opens, demonstrating the response message payload format from your database GET request.
      Response class for the database API
    2. Under the Parameters list, specify a lastName value of LAST1
    3. Click Try it out!.
      Information about the request URL, request headers, response body, response code, and response headers are provided.

      You will receive the following response body.

      {
      	"response": {
      		"result": [
      			{
      				"LASTNAME": "LAST1",
      				"ZIPCODE": "D01/r01",
      				"FIRSTNAME": "FIRST1",
      				"EXTENSION": "8-111-1111"
      			}
      		]
      	}
      
      }

The following steps describe how you can test your database service using a REST client:

  1. Start IMS and ensure that IMS Connect is listening on the expected port.
  2. Start your IBM z/OS Connect server if it is not already running. For more information, see Starting and stopping IBM z/OS Connect.
    1. Check the messages.log file for the following messages that confirm that the API is installed.
          BAQR7000I: z/OS Connect API archive file dbcontacts installed successfully.
      
    2. Check the messages.log file for the following messages that confirm that the service is installed.
          BAQR7043I: z/OS Connect service archive dbPhonebook installed successfully.    
      
  3. In a REST client, issue the following HTTP POST, or PUT, command:
    https://<yourServerName>:<port>/zosConnect/services/dbPhonebook?action=invoke

    Where <yourServerName> is the name of your server, and <port> is the port.

    Submit the following payload with your POST or PUT command:
    {
      "request":{
        "LASTNAME": "LAST1"
     }
    }

    If your service is working, you will get the following response body in your REST client.

    {
    	"response": {
    		"result": [
    			{
    				"LASTNAME": "LAST1",
    				"ZIPCODE": "D01/r01",
    				"FIRSTNAME": "FIRST1",
    				"EXTENSION": "8-111-1111"
    			}
    		]
    	}
    
    }

Results

You have verified your newly created database service is working.