是什么导致我间歇性的System.Net.WebException错误?

时间:2013-02-14 23:40:23

标签: c# dynamics-crm-2011

我有一个应用程序,它使用Microsoft Dynamics CRM的API来插入和更新记录。每当我连续处理少量记录时,我在尝试进行其中一个更新时遇到以下错误:

2013-02-14 10:25:56,382 - Updating lead in dynamics with leadid [3cdaa9d4-c276-e211-99b6-005056ab0822]
2013-02-14 10:25:58,737 - GetProperty
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Crm.SdkTypeProxy.Metadata.MetadataService.Execute(MetadataServiceRequest Request)
   at Integration.Crm.Services.Dynamics.LeadService.GetPickListvalue(String pickListlable, String logicalAttributeName) in C:\code\DynamicsIntegration\Services\LeadService.cs:line 1256

在Google上搜索,我发现了可能出现此特定错误(System.IO.IOException: Authentication failed because the remote party has closed the transport stream.)的几个原因,但在所有情况下,由于配置错误或证书损坏,它每次都发生

世界上有什么可能触发此错误间歇

它与Web请求的内容无关,因为我可以在5分钟后处理相同的请求并且它可以正常工作。对此服务器的所有请求大约10%的折扣会导致此错误。

编辑:以下是使用SharePoint similar problem的人,但每次都会发生错误。

1 个答案:

答案 0 :(得分:1)

使用CRM诊断工具打开跟踪日志记录:http://crmdiagtool2011.codeplex.com以查看是否收到任何其他错误信息(假设您正在使用On Premise)。我猜你的CRM服务器到SQL数据库的SQL连接不太对。