WSDL ElementForm Unqualified
From: Simon (Simon_at_discussions.microsoft.com)
Date: 03/02/05
- Next message: Keenan Newton: "Re: Can a Web Service be part of an C# Application"
- Previous message: Thomas S. Trias: "Re: BUG in Microsoft.Web.Services2.WebServicesClientProtocol WSE 2"
- Next in thread: Dilip Krishnan: "Re: WSDL ElementForm Unqualified"
- Reply: Dilip Krishnan: "Re: WSDL ElementForm Unqualified"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 2 Mar 2005 08:55:03 -0800
Hi -
I have a webservice with WSDL specifying 'elementFormDefault' set to
'unqualified'. I find when I try to process the incoming XML the raw XML
either looks like this:
<s0:rootelement xmlns:s0="myns">
<ChildElement></ChildElement>
</s0:rootelement >
or like this:
<rootelement xmlns="http://tempuri.org/">
<ChildElement></ChildElement>
</rootelement >
So far the only way I can deal with it which works consistently is like this:
XmlNode node = nodeInput.SelectSingleNode("/element");
if (node == null) {
XmlNamespaceManager mgr = new XmlNamespaceManager(node
.OwnerDocument.NameTable);
mgr.AddNamespace("ns", "myns");
node = nodeInput.SelectSingleNode("/ns:element", mgr);
}
which seems wrong. Is there a way of reading the nodes from an XPath which
doesn't require the 'if'?
Thanks,
Simon
- Next message: Keenan Newton: "Re: Can a Web Service be part of an C# Application"
- Previous message: Thomas S. Trias: "Re: BUG in Microsoft.Web.Services2.WebServicesClientProtocol WSE 2"
- Next in thread: Dilip Krishnan: "Re: WSDL ElementForm Unqualified"
- Reply: Dilip Krishnan: "Re: WSDL ElementForm Unqualified"
- Messages sorted by: [ date ] [ thread ]