You can set up a non-Java environment for processing JSON
requests. To create the CICS® infrastructure
for a non-Java JSON service provider, you must create a pipeline configuration
file and create a number of CICS resources.
Procedure
- Define the transport infrastructure.
Define
a TCPIPSERVICE resource that defines the port on which inbound requests
are received. See CICS resources
for web services for details.
- Define the message handlers
that you want to include in the pipeline configuration file to process
inbound web service requests, and their responses.
If you want to perform your own processing in the pipeline, you must create a message handler.
See Message handlers for details. If you
decide to create custom message handler programs, to optimize performance you must make them
threadsafe.
- Create an XML pipeline configuration file that contains
your message handlers.
In the configuration file, you must specify terminal handler program DFHPIJT
in a <terminal_handler> element as shown in Figure 1. DFHPIJT is the CICS-supplied JSON handler program
that enables non-Java processing of JSON messages.
Figure 1. Specifying terminal
handler DFHPIJT for non-Java processing of JSON
messages <service>
<terminal_handler>
<handler>
<program>DFHPIJT</program><handler_parameter_list/>
</handler>
</terminal_handler>
</service>
Note: When you use DFHPIJT as the terminal handler,
do not define an application handler in the pipeline configuration file, that is, the pipeline
configuration file should not contain an <apphandler> element. If an application
handler is specified, it is not invoked.
For more information about
options available in the pipeline configuration file, see Elements used in service provider and service requester pipelines.
- Copy the pipeline configuration file
to a suitable directory in z/OS® UNIX.
- Change the pipeline configuration
file permissions to allow the CICS region
to read the file.
- Create a PIPELINE resource. The PIPELINE resource defines the location of the pipeline configuration
file. It also specifies a pickup directory, which is
the z/OS UNIX directory that contains the web service
binding files. Repeat this step for each different pipeline configuration. When you install a PIPELINE resource or perform a PIPELINE
SCAN, CICS reads the .wsbind files
in the specified pickup directory, and creates appropriate WEBSERVICE and URIMAP resources dynamically.
- Unless you use autoinstalled
PROGRAM definitions, create a PROGRAM resource
for each program that runs in the pipeline. These include the target
application program, which normally runs under transaction CPIH. The
transaction is defined with the attribute TASKDATALOC(ANY).
Therefore, when you link-edit the program, you must specify the AMODE(31) option.
Results
You have created the infrastructure needed for
each service provider and you can now install these resources on your CICS system.
What to do next
Install the resources. You can extend the configuration
when you need to do so, either to define additional transport infrastructure,
or to create additional pipelines.