If I do XmlSerializer.Deserialize( myString ) and myString is:
String myString = "<?xml version=\"1.0\"
encoding=\"utf-16\"?><DocumentResponse ><documentSize
xmlns=\"urn:webservices.docharbor.com\">23</documentSize></DocumentResponse>";
It's working
But if myString is:
String myString = "<?xml version=\"1.0\"
encoding=\"utf-16\"?><DocumentResponse
xmlns=\"urn:webservices.docharbor.com\"><documentS ize
23</documentSize></DocumentResponse>";
It's not working!
XmlDocument is also part of the problem because when I use XmlDocument and I
put a namespace to every
node:
XmlElement children =
document.CreateElement(soapNode.Name,DOCHARBOR_TYP E_URN);
It will remove the namespace to all children except the root when I do this:
xml.WriteTo(new
XMLTextWriter(...))
The declaration of DocumentResponse look like this:
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="urn:webservices.docharbor.com")]
public class DocumentResponse {
/// <remarks/>
public int documentSize;
}
1- Please confirm that XmlSerializer.Deserialize has a bug.
2- Please give me a good workaround.
3- Let me know if the bug will be inserted in your bug tracker.