系统内存不足异常SOAP(XML)

时间:2017-12-01 15:58:14

标签: c# xml web-services soap

尝试通过SOAP协议检索和加载XML文件时,我有一个随机异常

XmlDocument xml = new XmlDocument();
using (Stream stream = webRequest.GetResponse().GetResponseStream())
{
   xml.Load(stream); //<-- Exception here
}

我测试了大小为267MB的文件。这是一个系统集成系统,系统会与所有员工一起生成XML。数据包括其个人资料的图片。一切都运作良好。但最近我遇到了一些例外情况:

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)

我想知道每个节点是否有大小限制。该文件仅包含大小为15MB的数据,但是一旦节点中包含的文件中base64中的图片大小增加到260M,但在测试和生产中仍然运行良好。

最近我遇到了这个问题。

0 个答案:

没有答案