You can call a REST API from an IMS™ applications by using IBM® z/OS® Connect Enterprise Edition (z/OS Connect EE) V3 as the solution.
You have an IMS COBOL application that needs to call a REST API to retrieve the contact information based on a person's last name.
This scenario uses the API requester feature in z/OS Connect EE to handle:
- The API request from an IMS application
- Data conversion between byte arrays and XML
- The API response back to IMS
z/OS Connect EE provides a Build toolkit that lets you generate the required artifacts based on the REST API's Swagger document. The generated files include:
- The API information file that describes the API name, the API path, exposed API methods and other information that is required to communicate with the communication stub. The communication stub is provided with z/OS Connect EE and must be configured on IMS for communication with the z/OS Connect EE server.
- The copybooks that contain the language structures of the request and response messages.
- An API requester archive (.ara) file that needs to be deploy to the z/OS Connect EE server.
To call the REST API, your IMS application must first include the generated API information file and the request and response message copybooks. You can then specify the content for the request, retrieve the response, and, if an error occurs with the call, identify where the error occurs to help take the appropriate remedial action.
- z/OS Connect EE V3 : its API requester feature and Build toolkit
You can try out this feature in two ways:
- Go to IBM Z Trial Program and register to try out z/OS Connect Enterprise Edition, at zero cost with no installation required.
- Download the z/OS Connect EE open beta. After z/OS Connect EE is properly installed and a server instance is created, follow the steps in the Quick Start scenario for Calling a REST API from an IMS or batch application.