Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

WSDL ElementForm Unqualified

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon - 02 Mar 2005 16:55 GMT
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
Dilip Krishnan - 02 Mar 2005 17:42 GMT
Hello Simon,
  No there is not. Also, its probably not the right thing to do however
to have it set to unqualified... That seems to deviate from the design principle
that wsdl is a contract and clients need to adhere to it. What that essentially
means is you're letting clients send any xml that 'looks' like what the server
expects and the service is having to deal with the various clients.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> Hi -
>
[quoted text clipped - 26 lines]
>
> Simon

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.