ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportIIB HTTP request JSON array issue

Post new topicReply to topic
IIB HTTP request JSON array issue View previous topic :: View next topic
Author Message
IIB_DEV
PostPosted: Thu Jun 14, 2018 4:00 am Post subject: IIB HTTP request JSON array issue Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Jun 14, 2018 4:44 am Post subject: Re: IIB HTTP request JSON array issue Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25361
Location: Ohio, 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
View user's profile Send private message
IIB_DEV
PostPosted: Thu Jun 14, 2018 5:18 am Post subject: IIB HTTP request JSON array issue Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Jun 14, 2018 5:44 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25361
Location: Ohio, 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
View user's profile Send private message
IIB_DEV
PostPosted: Mon Jun 18, 2018 1:42 am Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Jun 18, 2018 10:38 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25361
Location: Ohio, 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
View user's profile Send private message
IIB_DEV
PostPosted: Tue Dec 04, 2018 8:23 pm Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportIIB HTTP request JSON array issue
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.