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.

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#.