日期:2014-05-17  浏览次数:21594 次

接收对 https://xx.com/xx.svc的 HTTP 响应时发生错误。这可能是由于服务终结点绑定未使用 HTTP 协议造成的
WPF应用程序调用WCF是出现这个了,这怎么解决?

System.ServiceModel.CommunicationException: 接收对 https://xx.com/xx.svc的 HTTP 响应时发生错误。这可能是由于服务终结点绑定未使用 HTTP 协议造成的。这还可能是由于服务器中止了 HTTP 请求上下文(可能由于服务关闭)所致。有关详细信息,请参见服务器日志。 ---> System.Net.WebException: 基础连接已经关闭: 接收时发生错误。 ---> System.IO.IOException: 无法从传输连接中读取数据: 远程主机强迫关闭了一个现有的连接。。 ---> System.Net.Sockets.SocketException: 远程主机强迫关闭了一个现有的连接。
   在 System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   在 System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.Net.Security._SslStream.EndRead(IAsyncResult asyncResult)
   在 System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
   在 System.Net.PooledStream.EndRead(IAsyncResult asyncResult)
   在 System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
   --- 内部异常堆栈跟踪的结尾 ---

Server stack trace: 
   在 System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   在 System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   在 System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(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)
   在 Sinopec.UC.Client.Groups.ChatGroupSev.IChatGroupPersistence.EndGetGroupListByMember(IAsyncResult result)
   在 Sinopec.UC.Client.Groups.ChatGroupSev.ChatGroupPersistenceClient.OnEndGetGroupListByMember(IAsyncResult result)
   在 System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
WPF?WCF WPF? WCF 错误