IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Implement JSON in CICS from COBOL


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rick Silvers

New User


Joined: 31 Mar 2012
Posts: 9
Location: USA

PostPosted: Wed Dec 16, 2015 4:44 am
Reply with quote

Hi!

We are trying to implement JSON in CICS from COBOL but keep getting some weird things going on. We are using bottom-up approach ...taking COBOL copybooks created from a .NET JSON request and creating the JSON schemas. Using the example chapter 11 in redbook Implementing IBM CICS JSON Web Services for Mobile Applications. All the artifacts are created in the z/FS along with the wsbind file. Code has been added to COBOL program using CICS commands to create channels/containers and web open and web post and the DFHJSON link program to convert cobol data to JSON. Bundle and URIMAP created to point to .NET web services

All works well containers DFHJSON-TRANSFRM gets created, DFHJSON-DATA gets created and the link to DFHJSON works and creates the JSON schema containing the data from DFHJSON-DATA

web open works fine but the web converse gets a HTTP 400 - bad request ...what we found out the DFHJSON is putting the whole schema and the .NET side is only expecting the 4 request fields

also when I use the JSON assistants to recreate the wsbind file it doesn't get refreshed and it tries to use previous version of the wsbind/bundle part even though it has been deleted out of the z/FS directory before the new/changed JSON runs

If anyone has experience setting up a CICS JSON as a client to another environment such as .NET ...any suggestions would be greatly appreciated

Thank you,
Rick
Back to top
View user's profile Send private message
Rick Silvers

New User


Joined: 31 Mar 2012
Posts: 9
Location: USA

PostPosted: Sun Jan 03, 2016 1:30 am
Reply with quote

We have it working after few trial and errors. CICS is acting as a web service client requesting information from Azure. NET....using top-down approach (JSON objects to JSON Schema and COBOL COPYBOOKs) via the JSON assistant DHFJS2LS...no RESTful...Below explains how it works

Have CICS System programmers define

URIMAP - with endpoint
BUNDELS - have to be in own separate z/FS directory (request,response1, response2)
TRANSids

Application programmers do this

1.Use JSON objects supplied by Azure .NET and create JSON schemas at jsonschema.net/#/
2. Add the schemas into z/FS with dir names matching to the BUNDLE names which also match the JSON container DFHJSON-TRANSFRM
3. Run DFHJS2LS for each schema with parms pointing to z/FS directory where schemas are located ...this step also creates the COBOL COPYBOOKS
4. After running DFHJS2LS.... JSBIND dir and Metadata and log files will be created in z/FS directory
5. Add the generated COBOL Copybooks and CICS commands PUT/GET JSON CONTAINERs,OPEN/CONVERSE/CLOSE WEB into your COBOL program using examples in Chapter 11 Developing a simple JSON web of the Implementing IBM CICS JSON Web Services for Mobile Applications service client application REDBOOK. The examples from the REDBOOK worked just like they are explained.....
Back to top
View user's profile Send private message
mbattu

New User


Joined: 19 Jan 2011
Posts: 15
Location: Toronto

PostPosted: Thu Oct 19, 2017 10:07 am
Reply with quote

Hi Rick,

I know it is an old topic but perfectly matches my requirement.

I too am trying to develop a WebService Requester on Mainframe to perform HTTP POST. Previously I have developed WebService Provider and it is straight forward but I am confused on below topic. Can you please explain or provide me materials to read. Thanks.

1) Bundle
2) How to create container DFHJSON-TRANSFRM, specifically what to put in it
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top