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 application data to JSON by linking to DFHJSON.
Before you begin
You must have an enabled JSONTRANSFRM bundle 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.
Procedure
- The application program must create a channel, for example
MyChannelName
,
and put the following containers into the channel.
- DFHJSON-DATA
- DFHJSON-TRANSFRM
- DFHJSON-JVMSERVR (optional)
For more information about these containers, see
JSON transformer linkable interface containers
.
- Use the
EXEC CICS LINK PROGRAM
command to
transform the data to JSON:
EXEC CICS LINK PROGRAM('DFHJSON') CHANNEL('MyChannelName')
- Get container DFHJSON-ERROR and check if any errors occurred
during the transformation.
- Get container DFHJSON-JSON and make use of the JSON in
your application.
- Install the application.
Results
When the application runs the
LINK
command,
CICS
checks the JSONTRANSFRM bundle
resource to find the mappings in the JSON binding and transforms the
application binary data to JSON by using the containers on the
channel.
The JSON is placed in the DFHJSON-JSON container on return. The JSON
conforms to the JSON schema that is defined in the JSONTRANSFRM
bundle
resource.
What to do next
You can also use the same mappings to transform JSON to application
data. For more information, see
Transforming JSON to application data by linking to DFHJSON.