![[z/OS]](ngzos.gif)
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
-
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 thezosConnectServiceelement. -
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.
-
Use ARC to issue an HTTP POST against the following URL:
https://HOST_NAME:HTTPS_PORT/oneWay -
Specify some valid JSON for the body, for example:
{"name1" : "value1", "name2" : "value2"}You need to specify two headers:- Authorization =
Basic ENCODED_USERID_PASSWORDwhere
ENCODED_USERID_PASSWORDis a base 64 encoded user ID and password as described in Basic Authentication Scheme. - 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.
- Authorization =
-
Use ARC to issue an HTTP POST against the following URL:
-
Use ARC to issue an HTTP DELETE against the following URL:
Doing this destructively gets the message that was just sent to the one-way service.https://HOST_NAME:HTTPS_PORT/oneWayThis 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.