【问题标题】:Dynamics CRM Cause CommunicationExceptionDynamics CRM 导致 CommunicationException
【发布时间】: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


    【解决方案1】:

    CRM 服务根本不喜欢在一个请求中检索大量数据。

    我建议您使用分页 cookie 按集检索您的记录。它应该可以解决您的问题并提高代码的性能。

    你可以在msdnhere找到一个不错的教程。

    问候,

    凯文

    【讨论】:

      猜你喜欢
      • 2017-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-12
      • 1970-01-01
      • 2017-07-22
      相关资源
      最近更新 更多