zoukankan      html  css  js  c++  java
  • System.ServiceModel.CommunicationException: 接收HTTP 响应时错误发生

    具体错误信息例如以下:

    System.ServiceModel.CommunicationException: 接收对 http://110.110.110.110/TestService/TestService.svc 的 HTTP 响应时错误发生。

    这可能是因为服务终结点绑定未使用 HTTP 协议造成的。

    这还可能是因为server中止了 HTTP 请求上下文(可能因为服务关闭)所致。有关具体信息,请參见server日志。

    ---> System.Net.WebException: 基础连接已经关闭: 接收时错误发生。

    ---> System.IO.IOException: 无法从传输连接中读取数据: 远程主机强迫关闭了一个现有的连接。。 ---> System.Net.Sockets.SocketException: 远程主机强迫关闭了一个现有的连接。

    在 System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) 在 System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- 内部异常堆栈跟踪的结尾 --- 在 System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) 在 System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) 在 System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) --- 内部异常堆栈跟踪的结尾 --- 在 System.Net.HttpWebRequest.GetResponse() 在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) --- 内部异常堆栈跟踪的结尾 --- Server stack trace: 在 System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) 在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 在 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: 在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) //部分出错函数信息提示

    错误原因:

           通过WCF来传递DataTable

    解决:

            WCF中传递的DataTable替换成Dataset(已验证)

    或者(未验证)

    图片资料来源:点击打开链接


     

  • 相关阅读:
    测试用例练习2
    测试小尝试
    两个栈实现队列 Python实现
    treap Python实现
    AVL树Python实现(使用递推实现添加与删除)
    AVL树Python实现
    跳表(skiplist)Python实现
    红黑树Python实现
    Django Middleware 之 SessionMiddleware
    软件测试——Peer Review(简介)
  • 原文地址:https://www.cnblogs.com/mengfanrong/p/5422580.html
Copyright © 2011-2022 走看看