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 Index » WebSphere Message Broker (ACE) Support » json wrapper

Post new topic  Reply to topic Goto page 1, 2  Next
 json wrapper « View previous topic :: View next topic » 
Author Message
srikanth2007
PostPosted: Thu Dec 10, 2015 4:19 pm    Post subject: json wrapper Reply with quote

Newbie

Joined: 10 Dec 2015
Posts: 9

hai, I have a requirement, I need to send a Json request to soap service without xml conversion using json wrapper and get the response in json format, can we build a json wrapper in compute node using esql. can you please suggest me a solution
Back to top
View user's profile Send private message
timber
PostPosted: Fri Dec 11, 2015 12:44 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

So you want to send a SOAP Envelope, but the contents of the soap:Body element will be a CDATA section containing JSON. Is that correct?
Back to top
View user's profile Send private message
srikanth2007
PostPosted: Fri Dec 11, 2015 7:28 am    Post subject: Reply with quote

Newbie

Joined: 10 Dec 2015
Posts: 9

yes perfectly
Back to top
View user's profile Send private message
srikanth2007
PostPosted: Fri Dec 11, 2015 7:43 am    Post subject: Reply with quote

Newbie

Joined: 10 Dec 2015
Posts: 9

can the soap service return the response in the json format
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 11, 2015 7:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

srikanth2007 wrote:
can the soap service return the response in the json format


No, because if it's a SOAP service (with a SOAP Envelope) anything that tries to parse the response (not just IIB) will think the JSON is badly formed XML unless it's in a CDATA section as described above.

If the "soap service" wants to return pure JSON with no SOAP Envelope or other non-JSON elements, then it's not a SOAP service. It's a REST service, and IIB supports that perfectly well.

But you can't mix the 2, and have JSON content inside an XML (SOAP) document. You either have nothing but JSON, or you have XML with a CDATA section. IIB supports both.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
srikanth2007
PostPosted: Fri Dec 11, 2015 8:04 am    Post subject: Reply with quote

Newbie

Joined: 10 Dec 2015
Posts: 9

ya i got your point, But whatever response comes from soap service, I need to invoke a rest service from response that I get from soap webservice, How it is going to be possible
Back to top
View user's profile Send private message
timber
PostPosted: Fri Dec 11, 2015 8:13 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

We need some more background information.
Are you trying to call a SOAP/XML web service from a JSON/REST environment? [/quote]
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 11, 2015 8:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

srikanth2007 wrote:
How it is going to be possible


You're asking how it's possible to invoke a REST service using the data in the response from the SOAP service?

By invoking the SOAP service, getting the response back and then invoking the REST service. Seriously.

Clearly you can't do it directly; you'll need a fragment of code to extract the JSON from the CDATA section. But just a fragment.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
srikanth2007
PostPosted: Fri Dec 11, 2015 8:33 am    Post subject: Reply with quote

Newbie

Joined: 10 Dec 2015
Posts: 9

yes, I'am invoking soap/xml webservice using json/rest environment, after that I should again call json/rest webservice
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 11, 2015 8:48 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

srikanth2007 wrote:
I'am invoking soap/xml webservice using json/rest environment


Ok - please explain in very specific technical terms what you mean here by "json/rest environment". Because IIB doesn't have anything that fits that description. It has a series of facilities that you can string together in any way.

So on the face of it, you can achieve what you want to achieve using the flow I outlined before. Therefore you need to explain very clearly what there is in this "environment" that's stopping you and that you're asking for advice on.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Fri Dec 11, 2015 8:58 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

My guess is that he is building a REST/JSON service that first has to call a SOAP web service and it then takes data from that response and calls a REST/JSON service before returning it's own response message.

But it would be nice to get a clear problem statement so we aren't left guessing at what the goal is.


Last edited by joebuckeye on Fri Dec 11, 2015 9:00 am; edited 1 time in total
Back to top
View user's profile Send private message
timber
PostPosted: Fri Dec 11, 2015 8:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

I agree with vitor - more information needed.
At minimum, you need to tell us which version of IIB you are using because it will affect the advice given.
Back to top
View user's profile Send private message
srikanth2007
PostPosted: Fri Dec 11, 2015 9:31 am    Post subject: Reply with quote

Newbie

Joined: 10 Dec 2015
Posts: 9

what I'am working on currently are all rest services except one, whice is soap service, here calling rest services is not a big deal, after that I need to call soap service where it does enrollment of an account, here before calling soap service I need to build a json wrapper using esql where json sits in the soap message where our client don't want a response in xml/soap from but in json from soap service, so that it should again call a rest service which emails the customer about confirmation.
I'am using wmb 8.006

Thank you for advicing me
Back to top
View user's profile Send private message
timber
PostPosted: Fri Dec 11, 2015 9:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

This sample does what you need. It's for v9, but it should give you a rough idea of what is required.

http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.samples.jsonrest.doc/doc/overview.htm?lang=en
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 11, 2015 2:01 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Beware of JSON in a CDATA section of an XML! Remember that "]]" will close the CDATA section and is easy to achieve in JSON.
Better use bit-64 or hex encryption for the JSON payload.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » json wrapper
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.