This is strange. I've got a WCF Message and I'm trying to read the contents of the body into an XmlDocument. The contents of the message body look like this on the wire (when inspected with WCF tracing turned on):
<abc>
<timeZone>(GMT-05:00) Eastern Time (US & Canada)</timeZone>
</abc>
The code for the reader looks like this:
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 messageDoc
looks like this:
<abc>
<timeZone>(GMT-05:00) Eastern Time (US &Canada)</timeZone>
</abc>
So where did the extra whitespace after the original &
go?