The JSON transformer linkable interface DFHJSON is a
CICS-supplied program that can be
called to perform transformation between application data and JSON. Your
application program can
transform JSON to application data by linking to DFHJSON.
You must have an enabled JSONTRANSFRM resource that defines the JSON
binding and
JSON schema. If you intend to perform transformations by using
Java™
, you must have an Axis2 JVM server already running.
About this task
Create or update an application program to link to the
CICS®
supplied program DFHJSON to do the transformation.
-
Create a channel, for example
MyChannelName
,
and put the following containers into the channel.
-
Use the
EXEC CICS LINK PROGRAM
API command to
transform the data to JSON:
EXEC CICS LINK PROGRAM('DFHJSON') CHANNEL('MyChannelName')
-
Get containers DFHJSON-ERROR and DFHJSON-ERRORMSG, and check if any errors occurred during the
transformation.
If a problem occurs during the transformation, an error code is returned in the DFHJSON-ERROR
container and a detailed message in the DFHJSON-ERRORMSG container. For more troubleshooting
information, see Troubleshooting problems with JSON requests.
-
Install the application program.
When the application runs the
LINK PROGRAM
command,
CICS
checks the JSONTRANSFRM resource
to find the mappings in the JSON binding and transforms the JSON to
the application data using the containers on the channel. The
application
data is placed in the DFHJSON-DATA bit container on return.
What to do next
You can also use the same mappings to transform application
data to JSON. For more information, see
Transforming application data to JSON by linking to DFHJSON.