View previous topic :: View next topic
|
Author |
Message |
mukun264
New User
Joined: 01 Jan 2008 Posts: 32 Location: Bangalore
|
|
|
|
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 |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
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 |
|
|
mukun264
New User
Joined: 01 Jan 2008 Posts: 32 Location: Bangalore
|
|
|
|
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 |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
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 |
|
|
mukun264
New User
Joined: 01 Jan 2008 Posts: 32 Location: Bangalore
|
|
|
|
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 |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
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 |
|
|
mukun264
New User
Joined: 01 Jan 2008 Posts: 32 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear this is resolved - thank you for posting the solution
d |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Sweet! |
|
Back to top |
|
|
|