954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

SOAP wrapper creation in C#

I need to create a SOAP wrapper of the form

<SOAP-ENV:Envelope xmnls=........><SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>


My C# code to do this is as follows

XmlElement soapEnvelope = document.CreateElement("SOAPENV", "Envelope", "http://schemas.xmlsoap.org/soap/envelope");
XmlElement soapBody = document.CreateElement("SOAPENV", "Body", "http://schemas.xmlsoap.org/soap/envelope");


This works fine for the Envelope part but then adds a spurious xmnls attribute to the Body part. How do I stop this from happening?

Many thanks.

hgbreton
Newbie Poster
5 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

I don't understand why are you not adding web references in project. When you add a web reference it parses the WSDL and creates strongly typed classes for the API.

For your reference read Dr. Dobb's article - Building an XML Wrapper Class in C# .

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: