Author |
Message
|
srikanth2007 |
Posted: Thu Dec 10, 2015 4:19 pm Post subject: json wrapper |
|
|
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 |
|
 |
timber |
Posted: Fri Dec 11, 2015 12:44 am Post subject: |
|
|
 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 |
|
 |
srikanth2007 |
Posted: Fri Dec 11, 2015 7:28 am Post subject: |
|
|
Newbie
Joined: 10 Dec 2015 Posts: 9
|
|
Back to top |
|
 |
srikanth2007 |
Posted: Fri Dec 11, 2015 7:43 am Post subject: |
|
|
Newbie
Joined: 10 Dec 2015 Posts: 9
|
can the soap service return the response in the json format |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 11, 2015 7:52 am Post subject: |
|
|
 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 |
|
 |
srikanth2007 |
Posted: Fri Dec 11, 2015 8:04 am Post subject: |
|
|
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 |
|
 |
timber |
Posted: Fri Dec 11, 2015 8:13 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Fri Dec 11, 2015 8:14 am Post subject: |
|
|
 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 |
|
 |
srikanth2007 |
Posted: Fri Dec 11, 2015 8:33 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Fri Dec 11, 2015 8:48 am Post subject: |
|
|
 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 |
|
 |
joebuckeye |
Posted: Fri Dec 11, 2015 8:58 am Post subject: |
|
|
 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 |
|
 |
timber |
Posted: Fri Dec 11, 2015 8:59 am Post subject: |
|
|
 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 |
|
 |
srikanth2007 |
Posted: Fri Dec 11, 2015 9:31 am Post subject: |
|
|
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 |
|
 |
timber |
Posted: Fri Dec 11, 2015 9:42 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 11, 2015 2:01 pm Post subject: |
|
|
 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 |
|
 |
|