[z/OS][V9.0.1 Nov 2016]

Testing the one-way service on z/OS Connect EE

A series of steps that ensures your one-way service is working.

Before you begin

Ensure that you have completed Setting up a simple one way MQ Service Provider service on z/OS Connect EE successfully.

Procedure

  1. Check that z/OS® Connect recognizes the new service.
    Do this by reissuing the steps detailed in Checking that z/OS Connect is correctly set up.
    As there is now a service defined, you should see something similar to the following output:
    
    ________________________________________
    { 
       "zosConnectServices":[ 
          { 
             "ServiceName":"oneWay",
             "ServiceDescription":"DATA_UNAVAILABLE",
             "ServiceProvider":"IBM MQ for z/OS service provider for IBM z/OS Connect EE V2.0",
             "ServiceURL":"https://yourdomainname:12342/zosConnect/services/oneWay"
          }
       ]
    }
    ________________________________________
    
    Note: The ServiceDescription is returned as DATA_UNAVAILABLE because the serviceDescription attribute was not specified on the zosConnectService element.
  2. Issue an HTTP POST to the service. This results in a new message being sent to the ONE_WAY_QUEUE with whatever payload was specified on the POST.
    A good way of performing this sort of testing is to use something like the Advanced REST client (ARC) plug in for Google Chrome.
    1. Use ARC to issue an HTTP POST against the following URL:
      https://HOST_NAME:HTTPS_PORT/oneWay
    2. Specify some valid JSON for the body, for example:
      {"name1" : "value1", "name2" : "value2"}
      You need to specify two headers:
      1. Authorization = Basic ENCODED_USERID_PASSWORD

        where ENCODED_USERID_PASSWORD is a base 64 encoded user ID and password as described in Basic Authentication Scheme.

      2. Content-Type = application/json

      The first header is used to log in to z/OS Connect and is an encoded form of the user ID and password used in Enabling z/OS Connect and the MQ Service Provider.

      The second header informs the server that the payload is JSON, which is the only supported value when issuing HTTP POST calls to the MQ Service Provider.

      If you do not specify this header, an HTTP 415 error, which indicates an unsupported media type results.

      Issuing an HTTP POST to a one-way service results in an empty HTTP response body and an HTTP response code of 204 (no content) being returned.

      ARC outputs a message saying that the response does not contain any data.

      To validate that a message has been put, use a tool like the IBM® MQ Explorer to browse the contents of ONE_WAY_QUEUE. There should be an IBM MQ message of format MQSTR on the queue with the JSON payload that was sent.

  3. Use ARC to issue an HTTP DELETE against the following URL:
    https://HOST_NAME:HTTPS_PORT/oneWay
    Doing this destructively gets the message that was just sent to the one-way service.

    This should give a response body containing the JSON payload that was originally sent. You can use IBM MQ Explorer to confirm that the message has been destructively got.