Author |
Message
|
IIB_DEV |
Posted: Thu Jun 14, 2018 4:00 am Post subject: IIB HTTP request JSON array issue |
|
|
Newbie
Joined: 14 Jun 2018 Posts: 4
|
Dear All,
I am getting some JSON array exception in my IIB V10 development.
My requirement is to get the JSON in HTTP input, do some transformation send data to HTTP REQUEST and get Response, capture few fields and construct required JSON and send response to HTTP Reply node..
HTTP Response :: From back-end service am getting JSON array message.
Problem statement :
1. If am taking response from HTTP request node as JSON (Message Domain property : JSON), am not getting proper complete JSON am getting only last part in Array.
2. If am taking response from HTTP request node as BLOB (Message Domain property : BLOB), after that trying to CAST to character am getting error (Un-convertable character error)
3. same as step 2 taking BLOB from HTTP request node sending as it is to HTTP reply node, getting proper complete JSON array to source application(Client).
NOTE :: After HTTP response from back-end, I need to capture few fields and send response to HTTP reply node.
Please help to resolve this issue, while capturing the response message from back-end service.
Thanks,
IIB V10 Developer..[/b] |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jun 14, 2018 4:44 am Post subject: Re: IIB HTTP request JSON array issue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
IIB_DEV wrote: |
1. If am taking response from HTTP request node as JSON (Message Domain property : JSON), am not getting proper complete JSON am getting only last part in Array. |
How are you determining this? If you're looking in the graphical debugger, don't. Insert a Trace node with ${Root} and take a user trace. If your code is misbehaving, do the same.
The debugger is notoriously unhelpful with message tree issues, because ( by definition) it's having to interpret the message tree to show it to you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
IIB_DEV |
Posted: Thu Jun 14, 2018 5:18 am Post subject: IIB HTTP request JSON array issue |
|
|
Newbie
Joined: 14 Jun 2018 Posts: 4
|
Hi Vitor, Thanks for the reply.
No, We are not looking into graphical debugger, the same data(JSON) we sent to HTTP reply node, there we are not getting proper response (Full Array Body) to client applications and tools(Postman and SOAP-UI). Getting JSON response only Last Array element.
IF we specify BLOB on HTTP Request node,(Not doing any tranformation simply routing to HTTP Reply node) we are getting proper full JSON to client application and tools (Soap-UI & Postman).
NOTE : But I need to capture few elements in JSON response after getting reply from HTTP request node. (Tried with converting BLOB to CHAR to capture required details getting an UN-CONVERTABLE CHARACTER Error)..
Looking for your
Thanks,
IIB DEV.
 |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jun 14, 2018 5:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Trace node with a ${Root} in a user trace.
See what's actually coming back and why your code thinks it can only see one array element. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
IIB_DEV |
Posted: Mon Jun 18, 2018 1:42 am Post subject: |
|
|
Newbie
Joined: 14 Jun 2018 Posts: 4
|
Vitor wrote: |
Trace node with a ${Root} in a user trace.
See what's actually coming back and why your code thinks it can only see one array element. |
Hi Vitor,
We have added a trace node after HTTP Request node and captured entire message ${Root}, we have seen only last part is there in File (Last data in the array).
Please let me know if any changes required..
Thanks,
Vaibhav |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jun 18, 2018 10:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
So if the trace shows Root only has one array element with no intermediate code this points the finger at the response or the parser options. You've asserted that the stream (when interpreted as a BLOB) has all the array elements so it's the parser options on the node that's your next stop. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
IIB_DEV |
Posted: Tue Dec 04, 2018 8:23 pm Post subject: |
|
|
Newbie
Joined: 14 Jun 2018 Posts: 4
|
:clap: :clap:
Resolved
:clap: :clap:
SET OutputRoot.Properties.CodedCharSetId = 1208;
SET OutputRoot.Properties.Encoding = 546;
SET OutputRoot.HTTPInputHeader."Content-Type" = 'application/json; charset=utf-8'; |
|
Back to top |
|
 |
|