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

Send JSON data over Restful using CICS


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mukun264

New User


Joined: 01 Jan 2008
Posts: 32
Location: Bangalore

PostPosted: Fri Oct 18, 2013 1:20 am
Reply with quote

Hi,

I am trying to send JSON data from cics to Restful server using http call But I am getting Bad request from server.

But same data is getting process from open tool like crome.

any one have idea how to send JSON data from cics.

I study the manual but not helping to much icon_cry.gif
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Fri Oct 18, 2013 6:20 pm
Reply with quote

Can your http call from cics work with anything else?

I only ask because I usually have to start with something simple, like a straight out 'GET' against a known url, like Use [URL] BBCode for External Links. This allows me to know for certain that my mainframe region has connectivity.

Once you know that, then you have to start breaking it down...are you actually getting to the server, is the data in ASCII/UTF8 when it gets there, is your error message REALLY coming from the server, what does the server log tell you the problem is.
Back to top
View user's profile Send private message
mukun264

New User


Joined: 01 Jan 2008
Posts: 32
Location: Bangalore

PostPosted: Sat Oct 19, 2013 11:35 pm
Reply with quote

yes I have proven cics web call to other server and data was sent in XML and SOAP. this is first time our we are trying to send the data in JSON format to restful server.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Sun Oct 20, 2013 2:31 am
Reply with quote

OK, so how do you check to make sure the message/request is being formatted correctly? Are you able to look at it before it gets squeezed through the IP pipe?
Back to top
View user's profile Send private message
mukun264

New User


Joined: 01 Jan 2008
Posts: 32
Location: Bangalore

PostPosted: Sun Oct 20, 2013 3:04 pm
Reply with quote

we do not use pipe concept. but i am checking http header and its coming correct.

can you suggest me what other needs to be verify
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Mon Oct 21, 2013 9:42 pm
Reply with quote

OK...
The server is giving a bad response. What is the server being given to work with?

Verify the entire message, not just the header, by looking at the log from the server.

"But Ed, I don't have access to that" you say. Then take a look at what your program is actually outputting.

"But Ed, I don't know what to look for" you say. Then compare it to the data being sent from chrome.
Back to top
View user's profile Send private message
mukun264

New User


Joined: 01 Jan 2008
Posts: 32
Location: Bangalore

PostPosted: Tue Oct 22, 2013 10:22 pm
Reply with quote

Good news ,

The issue WaS resolved . There were a little error in my program. I defined data lenght as s9(4) comp instead of s9(8) comp. Due this the length was getting calculated wrongly .


There were some error in terms of content type. They were excepting in text/json but I was used application/json
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 23, 2013 12:40 am
Reply with quote

Good to hear this is resolved - thank you for posting the solution icon_smile.gif

d
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Oct 23, 2013 9:01 pm
Reply with quote

Sweet!
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Calling an Open C library function in... CICS 1
Search our Forums:

Back to Top