This is strange. I have a WCF Message and am trying to read the contents of a body in an XmlDocument. The content of the message body looks like this on the wiring (when checking with WCF trace):
<abc>
<timeZone>(GMT-05:00) Eastern Time (US & Canada)</timeZone>
</abc>
The code for the reader is as follows:
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreWhitespace = false;
settings.CheckCharacters = false;
XmlReader bodyReader = XmlReader.Create(
message.GetReaderAtBodyContents().ReadSubtree(), settings);
XmlDocument messageDoc = new XmlDocument();
messageDoc.Load(bodyReader);
The resulting XML in is messageDocas follows:
<abc>
<timeZone>(GMT-05:00) Eastern Time (US &Canada)</timeZone>
</abc>
So where were the extra spaces after the original made &?
source
share