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 / May 2005

Tip: Looking for answers? Try searching our database.

XmlNode - generation of WSDL problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PaulF - 25 May 2005 10:57 GMT
I am writing a web service that accepts and returns an XML message - I know
the issues behind this but want to be able to process the messages
generically using XSD / XSLT.

My problem occurs with the way the .NET framework appears to handle the
XmlNode, in particular the generation of the WSDL.  The details follow:

I define the code behind method as

[WebMethod]
public XmlNode Operation(xmlNode request)

However when I look at the WSDL generated I see the following for the input
XML Message:

<element name="Operation">
 <complexType>
   <sequence>
     <element minOccurs="0" maxOccurs="1" name="request">
       <complexType mixed="true">
         <sequence>
           <any />
         </sequence>
       </complexType>
     </element>
   </sequence>
</element>

Which results in the XML in the SOAP:Body looking like like this when called
using the reference.cs generated interface:
<Operation xmlns="..">
 <request>
     ....  I can place the XML I require here
 </request>
</Operation>

So the .NET framework - or is it the WSDL - has inserted an extra node
<request>  in the XML that I do not require.

Does anyone know how to define this so that THE COMPLETE XML DOCUMENT in the
SOAP:Body is handled by the XmlNode defined in the code behind without it
inserting its own nodes?

TFAH

Paul
PaulF - 25 May 2005 19:07 GMT
I have found a solution.  Specify the following just above the [WebMethod]

[SoapDocumentMethod{ParameterStyle =
System.Web.Services.Protocols.SoapParameterStyle.Bare)]

Finally make sure that the variable name for the parameter of the XmlNode on
the WebMethod is the same as the root node of your XML in the SOAP:Body.  The
XML is now starting to look like what you require.

> I am writing a web service that accepts and returns an XML message - I know
> the issues behind this but want to be able to process the messages
[quoted text clipped - 42 lines]
>
> Paul

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.