In my experience, it eaiser to either add the declaration to the string after you have the result from the webservice, or declare it it programatically.
Method 1 - Add XML declaration after reciept of data
string xmlStr = string.format(@" < ?xml version=\"1.0\" encoding=\"ISO-8859-1\"? > {0}", WebServiceStringResult)
Then you can create a new XML Document object from the concatenated string with :
YourXmlDocumentObject.ReadXML(xmlStr)
- And then loop over or xpath out the desired values. or
- Cast / Manipulate the YourXmlDocumentObject as required.
Method 2 - Programmatically add the XML/DTD declarations after reciept of data
In your new XmlDocument object, set the Properties to match your XML version and DTD information.
Finally, just add your webservice result string with:
YourXmlDocumentObject.ReadXML(WebServiceStringResult);
Note: Soap 1.1 and 1.2 will fall over with the declaration as part of an embedded request. ie the declaration is inside your one of your web methods.
~ ^i'm still learning to use this poxy editor, sorry ~