CICS TG - JSON Web Service, Identical Request & Response



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

CICS TG - JSON Web Service, Identical Request & Response

Postby joshua2896 » Fri Mar 17, 2017 6:43 pm

I am currently on a project, where I am using a JSON web service on the CICS TG to connect to a CICS Server sending a COMMAREA through an HTTP request, and returning it in the same fashion. to generate the necessary files for the CICS TG I am using the CTGLS2JS assistant. The question / problem that I am current dealing with is that when generating the files I would like to provide two different copybooks for the request, and response, both of which contain different information as the input, and output information are completely different from each other. Generating the wsbind file works fine. but when it comes to actually testing it, I receive a ABEND code of AZI6, which after doing some research and testing, I've come to the conclusion the both the input and output COMMAREA have to be the same. Reading up on the documentation it states that they both the LS-Request, and LS-Response must be different from each other. Bellow is a sample of the CTGLS2JS assistant code that I used that resulted in the ABEND .


LANG=COBOL
MAPPING-MODE=LS2JS
PGMINT=COMMAREA
TARGET-CICS-PLATFORM=AIX
LOGFILE=./captest.LOG
PGMNAME=CAPTEST
WSBIND=./captest.wsbind
LS-REQUEST=./request.cpy
LS-RESPONSE=./response.cpy
JSON-SCHEMA-REQUEST=./test-req.json
JSON-SCHEMA-RESPONSE=./test-res.json
STRUCTURE=(request,response)
DATA-TRUNCATION=ENABLED
 


If there is anything that I missed in the CTGLS2JS JCL that would help, or anything relating to the subject at hand please let me know ASAP please.
NOTE: This is my first time posting on this type of forum website, so I'm sorry if i break any rules, or have posted in the wrong section.
joshua2896
 
Posts: 4
Joined: Fri Mar 17, 2017 12:26 am
Has thanked: 0 time
Been thanked: 0 time

Re: CICS TG - JSON Web Service, Identical Request & Response

Postby Robert Sample » Fri Mar 17, 2017 7:21 pm

The question / problem that I am current dealing with is that when generating the files I would like to provide two different copybooks for the request, and response, both of which contain different information as the input, and output information are completely different from each other.
The manual implies but does not explicitly state that only one LS-REQUEST and LS-RESPONSE are allowed -- you're not going to be able to do what you'd like by providing multiple copybooks to CTGLS2JS.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: CICS TG - JSON Web Service, Identical Request & Response

Postby joshua2896 » Fri Mar 17, 2017 7:28 pm

Which manual are you referring to?
Most of the reading I've done is from the IBM website, more specifically from here https://www.ibm.com/support/knowledgece ... ls2js.html
joshua2896
 
Posts: 4
Joined: Fri Mar 17, 2017 12:26 am
Has thanked: 0 time
Been thanked: 0 time

Re: CICS TG - JSON Web Service, Identical Request & Response

Postby Robert Sample » Fri Mar 17, 2017 8:24 pm

Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: CICS TG - JSON Web Service, Identical Request & Response

Postby joshua2896 » Fri Mar 17, 2017 8:32 pm

Looking at the link, it says the same information as the page I sent, which states that both must be provided and must be different.
joshua2896
 
Posts: 4
Joined: Fri Mar 17, 2017 12:26 am
Has thanked: 0 time
Been thanked: 0 time

Re: CICS TG - JSON Web Service, Identical Request & Response

Postby Robert Sample » Fri Mar 17, 2017 8:43 pm

Yes, and the manual also says a VALUE must be provided -- not VALUES, no parentheses to indicate more than one can be provided. As I said, it implies but does not explicitly state you can only provide one for each (and they request and response must both be different).
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: CICS TG - JSON Web Service, Identical Request & Response

Postby joshua2896 » Fri Mar 17, 2017 9:37 pm

Yes I agree, outlining the problem that I'm having in simpler terms i have a copybook for request, and response, both of which are completely different from each other, that runs fine. but then i attempt to run the web service by sending an HTTP request in the format of the request copybook. the program runs fine, but when it attempts to return back it throws the ABEND AZI6, which i assume is because the response data is not the same, yet it works when both the request, and response copybooks are the same it works. also the input format for response does match the copybook used in the CICS program
joshua2896
 
Posts: 4
Joined: Fri Mar 17, 2017 12:26 am
Has thanked: 0 time
Been thanked: 0 time

Re: CICS TG - JSON Web Service, Identical Request & Response

Postby Robert Sample » Sat Mar 18, 2017 9:28 pm

Your response is as clear as mud.
i have a copybook for request, and response, both of which are completely different from each other, that runs fine.
Runs fine HOW? with web services? compiles clean? executes without using web services? something else you haven't explained? In other words, saying it "runs fine" tells us NOTHING about your problem.
the program runs fine, but when it attempts to return back it throws the ABEND AZI6, which i assume is because the response data is not the same
First, mainframe programs NEVER "throw" anything -- they may abend, they may have a non-zero return code, but they are NEVER "throw"ing anything.
Second, you need to make up your mind -- either the program "runs fine", or it gets an AZI6 ABEND -- it cannot do both.
Third, an AZI6 ABEND is, by itself, meaningless -- it says a remote connection transaction had an abend on the other side of the connection. Unless and until you find out what that abend is and resolve it, your AZI6 will not go away.
Fourth, do not "assume" anything -- because in my 40+ years of mainframe experience, approximately 95% of all programmer assumptions are WRONG. The manual explicitly tells you the request and response copy books MUST be different; if you assume your abend is due to something in the manual, your assumption is WRONG.
also the input format for response does match the copybook used in the CICS program
This is most likely the cause of the abend -- if the request or response data does not match what you told the system you were using, why would you NOT expect to get an abend?

You need to stop posting on this forum and start reading the manuals and Redbooks on CICS Web Services. After a few days or weeks or months of reading them, you need to work closely with your site support group to ensure the CICS definitions are set up correctly and the systems can communicate. You then should implement one of the IBM sample processes for CICS Web Services to understand how the programs are put together. Only after you have the sample process working exactly like it should, will you be ready to write your own code. You are attempting to take short cuts to understanding, and that rarely works out for the programmer.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to CICS

 


  • Related topics
    Replies
    Views
    Last post