【问题标题】:Why do I get connection aborted messages?为什么我会收到连接中止消息?
【发布时间】: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

【问题讨论】:

    标签: c# asp.net xml xml-rpc


    【解决方案1】:

    我认为关键可能在底部附近:

    +129 System.Xml.XmlDocument.Load(XmlReader reader) +108 System.Xml.XmlDocument.Load(Stream inStream) +91 CookComputing.XmlRpc.XmlRpcSerializer.DeserializeResponse(Stream stm, Type svcType) +189 [XmlRpcIllFormedXmlException: Response from server does not contain valid XML.]
    

    您的远程服务器正在响应一个无效的 xml 文档,您的连接似乎因此而中断。

    【讨论】:

      猜你喜欢
      • 2011-01-20
      • 2019-08-11
      • 1970-01-01
      • 2015-01-25
      • 1970-01-01
      • 2011-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多