Dear community,
CICS already offers quite a lot for the topic of web services. I am currently experimenting with connecting a web service that works with JSON format. On the mainframe side, PLI, COBOL and CICS V5R5 are used
A copybook is used as the basis for the structure. The name of the copybook is TEST01A and looks something like this:
DCL 02 MESSAGE CHAR(50);
In the JCL of the CICS JSON assistant, the PDSMEM must also be specified, which is called TEST01A. The JSON file and the JSON bind files are generated from this with the CICS JSON assistant DFHLS2JS. After that the JSON file looks like this:
{
"type":"object",
"properties":{
"test01a":{
"type":"object",
"properties":{
"message":{
"type":"string",
"maxLength":50,
"minLength":0
}
},
"required":[
"message"
]
}
},
"required":[
"test01a"
]
}
So far so good. The bundle resource is then created and installed in CICS. The web service is requested with GET and some query parameters. A JSON message comes back that looks like this:
{
"message": "okay"
}
The response is then transformed into the internal data format in TRANSFORM JSONTODATA. At this point, an error is returned that the message is not compliant.
I know why and I also know how I can work around the problem. I'm currently wondering if there isn't an easier way. I couldn't find anything about it in the documentation, which surprises me.
For the current problem, I would like to ask whether I can pass a parameter or something similar in DFHLS2JS that does not specify the high-level structure in the JSON file, so that the following JSON file is generated:
{
"type":"object",
"properties":{
"message":{
"type":"string",
"maxLength":50,
"minLength":0
}
},
"required":[
"message"
]
}
Did you have similar experiences and how did you deal with it?
Best regards
Adrian
------------------------------
Adrian Kawalla
------------------------------