I have tried to fins anything about this on Internet, and do get some hits. However, I don't seem to be able to figure out what is wrong. Anyone that have an idea?
The data should be ok. It starts like:
<?xml version= ......
Code:
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte[] bytesin = encoding.GetBytes(msgin);
ProtocolHeader protocolHdr = ProtocolHeader.ReadProtocolHeader(bytesin, 0, msgin.Length);
MemoryStream hdrin = new MemoryStream(bytesin, Convert.ToInt16(protocolHdr.ProtocolHeaderSize), msgin.Length - Convert.ToInt16(protocolHdr.ProtocolHeaderSize));
XmlReaderSettings xmlReaderSettings = new XmlReaderSettings();
xmlReaderSettings.IgnoreWhitespace = true;
XmlReader msginReader = XmlReader.Create(hdrin, xmlReaderSettings);
while (msginReader.Read())
{
// ...
}