【发布时间】:2012-07-31 01:45:55
【问题描述】:
我正在使用 MS Dynamics CRM api 从中获取数据(超过 5000 条记录)。
我正在使用基于 XML 的查询来获取数据
EntityCollection resultSet = _orgServiceProxy.RetrieveMultiple(new FetchExpression(query));
有时它会起作用,但大多数时候它会从日志中抛出异常,我收到了这个很长的异常。
接收到https://orgno.api.crm.dynamics.com/XRMServices/2011/Organization.svc 的 HTTP 响应时出错。这可能是由于服务端点绑定未使用 HTTP 协议。这也可能是由于服务器中止了 HTTP 请求上下文(可能是由于服务关闭)。有关更多详细信息,请参阅服务器日志。 ---> System.ServiceModel.CommunicationException: 接收到https://orgno.api.crm.dynamics.com/XRMServices/2011/Organization.svc 的 HTTP 响应时出错。这可能是由于服务端点绑定未使用 HTTP 协议。这也可能是由于服务器中止了 HTTP 请求上下文(可能是由于服务关闭)。有关更多详细信息,请参阅服务器日志。 ---> System.Net.WebException:底层连接已关闭:接收时发生意外错误。 ---> System.IO.IOException: Unable to read data from the transport connection: 一个现有的连接被远程主机强行关闭。 ---> System.Net.Sockets.SocketException: 远程主机在 System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) 处强制关闭现有连接 --- End of inner异常堆栈跟踪---在 System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System .Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) 在 System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) 在 System .Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream。读取(字节 [] 缓冲区,Int32 偏移量,Int32 大小)在 System.Net.Connection.SyncRead(HttpWebRequest 请求,布尔用户检索流,博olean probeRead) --- 内部异常堆栈跟踪结束 --- 在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 处的 System.Net.HttpWebRequest.GetResponse() --- 内部异常结束堆栈跟踪
我不知道为什么会这样?
【问题讨论】:
标签: c# communication dynamics-crm-2011 dynamics-crm-online communicationexception