Developing JSON web services
You can expose existing CICS® applications as JSON web services and create CICS applications to act as JSON web service providers. CICS does not provide built in support for requester mode JSON web services. But you can write CICS application programs to call a RESTful web service hosted on another system.
Before you begin
You must configure your CICS system to support JSON web services. For more information, see Creating the CICS infrastructure for a JSON service provider.
You must have fundamental knowledge about how CICS supports web services. See also Getting started with JSON web services.
Be aware of JSON web service restrictions.
Procedure
- Create a JSON web service.
- For JSON web service provider applications
- You can create a JSON web service provider application in one of three ways:
- Use the CICS JSON
assistant to create the JSON schema or language structures and deploy them into CICS. Use the PIPELINE SCAN command to
automatically create the required CICS resources.
The CICS JSON assistant is a supplied utility that helps you to create the necessary artifacts for a JSON web service provider application, or to enable an existing application as a JSON web service provider. The assistant can create a JSON schema from a high-level language structure or a high-level language structure from an existing JSON schema; it supports COBOL, C/C++, and PL/I. It also generates information that is used to enable automatic runtime conversion of the JSON messages to containers and COMMAREAs, and vice versa. This information is used by the CICS JSON web services support during pipeline processing.
See Creating a JSON service provider application for detailed instructions.
- Use z/OS® Connect to generate the mapping between a JSON schema or Swagger document and application data structures. See z/OS Connect Enterprise Edition product documentation to learn more.
- Use your own code to map between JSON and application data structures.
- Use the CICS JSON
assistant to create the JSON schema or language structures and deploy them into CICS. Use the PIPELINE SCAN command to
automatically create the required CICS resources.
- For JSON service requester applications
- You must use z/OS Connect Enterprise Edition for requester mode JSON web services. See z/OS Connect Enterprise Edition product documentation to learn more.
- For CICS applications to invoke remote JSON web services
- You can so without using z/OS Connect. You can write an application program to call a RESTful web service by using either the TRANSFORM DATATOJSON and TRANSFORM JSONTODATA API commands or the linkable interface, DFHJSON, to transform JSON and then using the WEB commands to send it to the remote service provider. For detailed instructions, see Creating a JSON web service client application.
- Start the JSON web service to test that it works as you intended.
These steps are explained in more detail in the following topics.