Author |
Message
|
simon.starkie |
Posted: Wed Aug 22, 2007 4:36 pm Post subject: WMB6 broker returns bad envelope namespace |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Looking at the actual exception tree in Visual Studio, I see in the following in the Inner Exception:
- InnerException {"Element 'Body' with namespace name '' was not found. Line 1, position 33."} System.Exception {System.Xml.XmlException}
The response XML I got back from the Broker was:
<?xml version="1.0"?><Envelope><NS1:Body xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/"><GetMedicationRequest><GetMedicationResponse><KPChartMetadata><mychartVersion>VERSION 1.0</mychartVersion></KPChartMetadata></GetMedicationResponse></GetMedicationRequest></NS1:Body></Envelope>
Obviously, there is no namespace in the NS1:Body at position 33 on Line 1.
It looks like the Broker is putting the rest of the "xmlns:NS1 etc" on a seperate line and confusing the parser in .NET
What can I do to solve this ... or is it a know problem and there may even be a fix?
Cheers!
*EDIT 08-24-2007* cleaned up the topic description a bit.
Last edited by simon.starkie on Fri Aug 24, 2007 10:08 am; edited 2 times in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 22, 2007 11:22 pm Post subject: Re: C# ws client gets "Response is not well-formed XML& |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
simon.starkie wrote: |
Looking at the actual exception tree in Visual Studio, I see in the following in the Inner Exception:
- InnerException {"Element 'Body' with namespace name '' was not found. Line 1, position 33."} System.Exception {System.Xml.XmlException}
The response XML I got back from the Broker was:
<?xml version="1.0"?><Envelope><NS1:Body xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/"><GetMedicationRequest><GetMedicationResponse><KPChartMetadata><mychartVersion>VERSION 1.0</mychartVersion></KPChartMetadata></GetMedicationResponse></GetMedicationRequest></NS1:Body></Envelope>
Obviously, there is no namespace in the NS1:Body at position 33 on Line 1.
It looks like the Broker is putting the rest of the "xmlns:NS1 etc" on a seperate line and confusing the parser in .NET
What can I do to solve this ... or is it a know problem and there may even be a fix?
Cheers! |
Don't get too confused. I believe that the real cause here is one line above: envelope has no namespace. So yes this is a malformed soap message in the first place....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
simon.starkie |
Posted: Thu Aug 23, 2007 11:32 am Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Well, looks like Websphere doesn't like the envelope namespace built by WMB6 either (see below).
So it looks like WMB6 is creating a malformed SOAP Envelope.
Specifically, this could be a problem with the way the IA90 Support Pack works?
Perhaps the SOAPExtract node isn't properly saving the SOAP Envelope?
Or the SOAPEnvelope isn't properly re-attaching the previously extracted SOAP Envelope in terms of a namespace issue?
Problem is easy to recreate...
1. installed IA90 Support Pack
2. drag your favorite WSDL to the Message Flow canvas to turn it into a web service
3. connect the flow so the SOAPEnvelope node re-attaches the previously saved SOAP Enevelope that was previously extracted by the SOAPExtract node in the subflow
4. Test with any web service proxy client (.NET or Websphere)
[8/23/07 12:16:46:181 PDT] 68be288f enterprise I com.ibm.ws.webservices.engine.enterprise WSWS3243I: Info: Mapping Exception to WebServicesFault.
[8/23/07 12:16:46:181 PDT] 68be288f enterprise I com.ibm.ws.webservices.engine.enterprise TRAS0014I: The following exception was logged WebServicesFault
faultCode: Server.generalException
faultString: org.xml.sax.SAXException: WSWS3052E: Error: Bad envelope namespace: To see the message containing the parsing error in the log, either enable web service engine tracing or set MessageContext.setHighFidelity(true).
faultActor: null
faultDetail:
org.xml.sax.SAXException: WSWS3052E: Error: Bad envelope namespace: To see the message containing the parsing error in the log, either enable web service engine tracing or set MessageContext.setHighFidelity(true).
at com.ibm.ws.webservices.engine.WebServicesFault.makeFault(WebServicesFault.java:173)
at com.ibm.ws.webservices.engine.SOAPPart.getSOAPEnvelope(SOAPPart.java:892)
at com.ibm.ws.webservices.engine.SOAPPart.getFault(SOAPPart.java:1262)
at com.ibm.ws.webservices.engine.Message.getFault(Message.java:791)
at com.ibm.ws.webservices.engine.Message.ifFaultThrowSelf(Message.java:771)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:252)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:255)
at com.ibm.ws.webservices.engine.client.Connection.invokeEngine(Connection.java:689) |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 23, 2007 11:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Could it be that you're passing in a bad Envelope in the first place?
It could be a bug in IA90, but it's not very likely.
I'm using it fairly often right now, and have not had these kinds of issues.
Either way, you should be able to see in debug trace or a couple of Trace nodes exactly what's going into SOAPExtract and coming out of SOAPEnvelop nodes. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
simon.starkie |
Posted: Thu Aug 23, 2007 11:38 am Post subject: Here are the SOAP Request and Response messages... |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
I think the input SOAP Envelope is OK.
Notice the output SOAP Envelope coming back from the broker is uite different.
SOAP REQUEST MESSAGE (from TCP TUNNEL):
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><GetMedicationRequest xmlns="http://svc.kp.org/hlth_admn/med_rcrd/KPChartService/v1"><patientMRN>123456789</patientMRN><region><typeID>9</typeID><description>ALL</description><code xsi:nil="true"/></region><patientSSN>987654321</patientSSN><serviceRequests/></GetMedicationRequest></soapenv:Body></soapenv:Envelope>
SOAP RESPONSE MESSAGE (from TCP TUNNEL):
<?xml version="1.0"?><Envelope><NS1:Body xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/"><GetMedicationRequest><GetMedicationResponse><KPChartMetadata><mychartVersion>VERSION 1.0</mychartVersion></KPChartMetadata></GetMedicationResponse></GetMedicationRequest></NS1:Body></Envelope> |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 23, 2007 11:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It seems like your flow is producing a bad SOAP envelope, yes.
You need to therefore isolate why.
Like I said, I personally don't think it's likely that it's the SOAP nodes, as I use them quite extensively and haven't had that problem.
So it is probably something else in the flow that's mangling things. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Bill.Matthews |
Posted: Thu Aug 23, 2007 11:54 am Post subject: |
|
|
 Master
Joined: 23 Sep 2003 Posts: 232 Location: IBM (Retired)
|
Since you are using the IA9O SupportPac - try changing where the SoapExtract stores the SOAP Envelope from the LocalEnvironment to the Environment. Of course the same change needs to be made for the SOAPEnvelope node.
A friend had a similar problem and this change fixed his messageflow (as suggested by Level 2). _________________ Bill Matthews |
|
Back to top |
|
 |
kimbert |
Posted: Thu Aug 23, 2007 12:29 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Jeff is right. This is almost certainly happening somewhere in your message flow. Put in Trace nodes or use the debugger to find out where.
By the way, I can assure you that message broker XML parsers do not insert linefeeds into their output unless instructed to do so ( i.e. unless they are in the message tree as text nodes ) |
|
Back to top |
|
 |
simon.starkie |
Posted: Thu Aug 23, 2007 1:28 pm Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Hey, first of all, I'd like to say thank you for all the help so far.
What I am doing is very simple.
I started over from scratch and created a brand new message flow.
I dragged the wsdl to the blank message flow canvas.
The only thing I changed in the IA90 generated message flow was to connect all three ExtractMessageBody terminals to the EnvelopeMessageBody. This was done so that a response would always be returned back to my web service proxy client to avoid a timeout when no response is returned.
I didn't change anything in the IA90 generated subflow.
I don't have any compute nodes in the IA90 generated message flow.
When I test with a .NET web service proxy client, it fails with:
InvalidOperationException
Response is not well-formed XML.
When I test with a RAD6 Websphere web service proxy client, it fails with:
org.xml.sax.SAXException: WSWS3052E: Error: Bad envelope namespace:
I think both error messages are basically complaining about the same thing...the SOAP Envelope is not valid XML.
I'm not sure what the trace nodes or using the debugger will accomplish...there really isn't anything in the message flow and subflow except what was generated by the IA90 plugin when I dragged the wsdl to the blank message flow canvas. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 23, 2007 2:03 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well.
Then try Bill.Matthews suggestion.
It isn't anything I've run into before, and it doesn't seem like it should be a problem.
But he says he's seen a similar issue, with a simple resolution. And I'd never doubt his word on such - I hear he knows a thing or two about this Broker stuff.
If that doesn't work, then open a PMR. IA90 is a Cat 3, so it's fully supported.
It's worth, also, making sure that you've downloaded the most recent version of IA90 and not installed something that could be a few months old.
It's also worth double-checking all your software versions against the IA90 requirements. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
simon.starkie |
Posted: Wed Aug 29, 2007 11:09 am Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Everything was solved when I started over from scratch.  |
|
Back to top |
|
 |
|