【发布时间】:2010-01-07 17:12:17
【问题描述】:
我有一个网络表单,它使用来自http://www.xml-rpc.net 的这个库向第三方服务发送数据。
最近表单开始抛出异常。我尝试在 web.config 中启用跟踪以查看来回传输的数据,但这似乎解决了问题,或者至少停止了抛出异常。
任何想法可能发生什么,或者我如何在没有明显解决问题的情况下诊断这个问题?
跟踪代码:
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
<add name="WebPageTraceListener"
type="System.Web.WebPageTraceListener, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</listeners>
</source>
</sources>
<switches>
<add name="System.Net" value="Verbose" />
</switches>
</system.diagnostics>
异常信息:
System.Net.Sockets.SocketException:已建立的连接被主机中的软件中止 [SocketException (0x2745): 已建立的连接被主机中的软件中止] System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +73 System.Net.Sockets.NetworkStream.Read(Byte[] 缓冲区,Int32 偏移量,Int32 大小) +131 [IOException:无法从传输连接读取数据:已建立的连接被主机中的软件中止。] System.Net.ConnectStream.Read(Byte[] 缓冲区,Int32 偏移量,Int32 大小) +313 System.Xml.XmlTextReaderImpl.ReadData() +444 System.Xml.XmlTextReaderImpl.EatWhitespaces(BufferBuilder sb) +285 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +74 System.Xml.XmlTextReaderImpl.ParseDocumentContent() +187 System.Xml.XmlTextReaderImpl.Read() +151 System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +48 System.Xml.XmlLoader.Load(XmlDocument 文档,XmlReader 阅读器,布尔型 preserveWhitespace)+129 System.Xml.XmlDocument.Load(XmlReader 阅读器)+108 System.Xml.XmlDocument.Load(Stream inStream) +91 CookComputing.XmlRpc.XmlRpcSerializer.DeserializeResponse(流 stm,类型 svcType)+189 [XmlRpcIllFormedXmlException:来自服务器的响应不包含有效的 XML。] CookComputing.XmlRpc.XmlRpcSerializer.DeserializeResponse(流 stm,类型 svcType)+238 CookComputing.XmlRpc.XmlRpcClientProtocol.ReadResponse(XmlRpcRequest req, WebResponse webResp, Stream respStm, Type returnType) +111 CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] 参数) +762 CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(MethodInfo mi, Object[] 参数) +11 XmlRpcProxyfd5eb8e7-d547-4544-bd38-7d6dc1366a49.login(字符串用户名,字符串密码)+120
【问题讨论】: