I have a random exception when trying to retrieve and load an XML file through SOAP protocol like this
XmlDocument xml = new XmlDocument();
using (Stream stream = webRequest.GetResponse().GetResponseStream())
{
xml.Load(stream); //<-- Exception here
}
I did test of files with a size of 267MB. It is a system integration where a system generate a XML with all the employees' data including picture of their profiles. Everything worked well. But recently I am experiencing some exceptions with this detail:
at System.Text.StringBuilder.ToString()
at System.Xml.XmlTextReaderImpl.ParseText()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(Stream inStream)
I wonder if there is a size limit on each node. The file only contained data with a size of 15MB, but once the file included in a node a picture in base64 the size increased to 260M, but still worked well on tests and production.
It is lately that I have this problem.