Author |
Message
|
harristm |
Posted: Fri Feb 07, 2014 8:51 am Post subject: Remove XML Declaration from a SOAP based web service call |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
I am using IIB 9.0.0.1 on Red Hat Linux 6.4 on a x86 laptop.
I am trying to connect to a web service.
When I use the WSDL and Web Service Explorer it builds the following request format.
Code: |
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<inXML>
"Data string payload"
</inXML>
</soapenv:Body>
</soapenv:Envelope> |
When I build the request using the same WSDL and the IIB Toolkit to generate SOAP Request node I get the message but it has an XML header on it, and the web service replies with an HTTP 500 Java Null Pointer Exception.
Code: |
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<inXML>
"Data string payload"
</inXML>
</soapenv:Body>
</soapenv:Envelope>
|
I have tried using a HTTP Request node but I haven't figured out exactly how to build send the message with a HTTP Request node.
The web service team points to WSE and ther other Java based clients that aren't having any trouble with the request format. So, this is on me to sort out with IIB instead of the web service.
Is the leading XML tag required in the SOAP Protocol?
Is there a control somewhere in the WSDL to manage the leading XML tag?
What is the best way to build and send this message to the web service using IIB ?
Thank you for your help
Sincerely
Tracy |
|
Back to top |
|
 |
dogorsy |
Posted: Fri Feb 07, 2014 9:01 am Post subject: Re: Remove XML Declaration from a SOAP based web service cal |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
harristm wrote: |
So, this is on me to sort out with IIB instead of the web service.
|
why ? what do you think is wrong with that message ? |
|
Back to top |
|
 |
McueMart |
Posted: Fri Feb 07, 2014 9:08 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Quote: |
and the web service replies with an HTTP 500 Java Null Pointer Exception. |
Are you saying that the NPE is happening in the web service? If so can you enquire what the cause is? Sounds like it might be a badly coded web service which cant deal with valid XML! |
|
Back to top |
|
 |
dogorsy |
Posted: Fri Feb 07, 2014 9:10 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
McueMart wrote: |
Sounds like it might be a badly coded web service which cant deal with valid XML! |
Exactly ! |
|
Back to top |
|
 |
harristm |
Posted: Fri Feb 07, 2014 9:42 am Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
Thank you for your responses!!!
I am saying that when the <?XML header is on the request, it fails and when it is not it works.
I have a flow with a File Input node that routes directly to a HTTP request.
I drop the file with the <?XML header on it in and the response comes back HTTP 500 Server error and has a NPE as the message.
I drop the file that doesn't have the <?XML header on it and the response comes back HTTP 200 with the data I'm hoping for in the Body a SOAP Envelope.
I not arguing that the service is properly or improperly coded. I just want to find a way to take the <?XML header off of my request just like Web Service Explorer does.
I think it will take me much less time to figure out how to take the <?XML header off of my request than it will take to explain to the web service guys, have them agree to fix it, find the money to fix it, then convene a project to implement, test, schedule, and deploy agreed fix.
I'm just ned to find a way to build a request and get it to the web service from ESQL. I can already prove it works with a text editor.
as always
Thank you very much for your help and advice
Tracy
Last edited by harristm on Fri Feb 07, 2014 9:49 am; edited 1 time in total |
|
Back to top |
|
 |
dogorsy |
Posted: Fri Feb 07, 2014 9:47 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
harristm wrote: |
Thank you for your responses!!!
I am saying that when the <?XML header is on the request, it fails and when it is not it works.
I have a flow with a File Input node that routes directly to a HTTP request.
I drop the file with the <?XML header on it in and the response comes back HTTP 500 Server error and has a NPE as the message.
I drop the file that doesn't have the <?XML header on it and the response comes back HTTP 200 with the data I'm hoping for in the Body a SOAP Envelope.
I not arguing that the service is properly or improperly coded. I just want to find a way to take the <?XML header off of my request just like Web Service Explorer does.
I think it will take me much less time to figure out how to take the <?XML header off of my request than it will take to explain to the web service guys, have them agree to fix it, find the money to fix it, then convene a project to implement, test, schedule, and deploy agreed fix. |
When my son cries because I do not buy him 100 bucks worth of sweets, I do not go and buy him the sweets so that he stops crying... even though it is quicker than educating him !! |
|
Back to top |
|
 |
harristm |
Posted: Fri Feb 07, 2014 9:57 am Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
Dogorsy:
I agree with you with respect to raising children. To work with your analogy, this is like having a fancy dinner date and finding out that your neighbor needs you to watch their kid at the last minute. I'm just trying to get through the evening with the minimum of issues.
Tracy  |
|
Back to top |
|
 |
dogorsy |
Posted: Fri Feb 07, 2014 10:00 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
harristm wrote: |
Dogorsy:
I agree with you with respect to raising children. To work with your analogy, this is like having a fancy dinner date and finding out that your neighbor needs you to watch their kid at the last minute. I'm just trying to get through the evening with the minimum of issues.
Tracy  |
don't know. Never had a fancy dinner date ( or a date ! ) |
|
Back to top |
|
 |
harristm |
Posted: Fri Feb 07, 2014 10:27 am Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
So, back to my question, how do I not send the <?XML header from IIB ?
Thanks
Tracy |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 07, 2014 10:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
harristm wrote: |
I think it will take me much less time to figure out how to take the <?XML header off of my request than it will take to explain to the web service guys, have them agree to fix it, find the money to fix it, then convene a project to implement, test, schedule, and deploy agreed fix. |
Guess again.
harristm wrote: |
I'm just ned to find a way to build a request and get it to the web service from ESQL. I can already prove it works with a text editor. |
Using the HTTPRequest node is straightforward. The hard part is building the request, and you do that exactly as you would expect - with ESQL, one tag at a time. You might be able to mitigate some of this work with the SOAPEnvelope node but if the example is as simple as you've posted that's probably not worth it.
Likewise this method is suitible if the request is as simple as you post. If it contains WS-Security, WS-Addressing or any advanced web service features then you're in a world of hurt. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 07, 2014 10:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
harristm wrote: |
To work with your analogy, this is like having a fancy dinner date and finding out that your neighbor needs you to watch their kid at the last minute. |
So you tell your neighbor that you've got a date, they're SOL and need to find a solution to their own problem
Or in this instance, their web service fails when it's presented with perfectly valid XML (I use the word specific specifically). If it fails with a NPE they have a bug in their code which they need to address. The fact that you've discovered a workaround at your end is irrelevent.
(And you think developing ESQL to fudge a request will take less time than saying that? You may cut and paste this into an email if it helps)
Also consider this. Given that it fails for this valid use case, how many other bugs are in it that they didn't find in their obviously inadequate testing? How many other compromises will you have to make? To close with the analogy, if you give up your date to look after the neighbor's kid, the next thing you know there are unfortunate biological products all over your floors, parts of your house are scortched and you're wishing the ER was closer. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
harristm |
Posted: Fri Feb 07, 2014 10:46 am Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
Vitor:
Thank you
Yes, the message is as simple..
Is there a way to paste an xmlns on an element like '<soapenv:Envelope'
I tried "OutputRoot.XMLNSC.Envelope = " but that just gave me <Envelope>
I wish there was a little switch in the SOAP request node.
Ohh well. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 07, 2014 10:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
harristm wrote: |
Is there a way to paste an xmlns on an element like '<soapenv:Envelope' |
Yes.
harristm wrote: |
Is there a way to paste an xmlns on an element like '<soapenv:Envelope>' |
Yes. Search in the InfoCenter for "adding namespaces".
harristm wrote: |
I tried "OutputRoot.XMLNSC.Envelope = " but that just gave me <Envelope> |
Of course it did. What part of that ESQL would create a namespace?
harristm wrote: |
I wish there was a little switch in the SOAP request node. |
There isn't. Because it's not needed.
Good luck with the neighbor's bratty kid. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Feb 07, 2014 12:00 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
harristm wrote: |
So, back to my question, how do I not send the <?XML header from IIB ?
Thanks
Tracy |
I'd expect the answer is by not adding it!
Did you verify that your flow does not automatically add the XML header  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|