2013-02-14 82 views
1

我有一個應用程序使用Microsoft Dynamics CRM的API來插入和更新記錄。每當我連續過程的記錄屈指可數,我打了以下錯誤試圖使更新之一時:是什麼導致我的間歇性System.Net.WebException錯誤?

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 

谷歌搜索的時候,我發現爲什麼這個錯誤(System.IO.IOException: Authentication failed because the remote party has closed the transport stream.)可能occurr有幾個原因,但在所有情況下,由於配置錯誤或證書損壞,每次發生時,都會發生此問題

什麼在世界上可能觸發這個錯誤間歇

它與Web請求的內容無關,因爲我可以在5分鐘後處理相同的請求,並且它可以工作。對此服務器的所有請求約有10%會導致此錯誤。

編輯:這裏有人用similar problem使用SharePoint,但每次都發生錯誤。

+0

什麼版本的CRM?數據塊傳輸有多大? – 2013-02-15 06:53:30

+0

之間有什麼東西(代理,防火牆,...)? – ccellar 2013-02-15 10:11:04

+0

你是不是在多個線程之間共享上下文/ IOrganization服務? – Daryl 2013-02-15 11:52:28

回答

1

使用CRM診斷工具打開跟蹤日誌記錄:http://crmdiagtool2011.codeplex.com以查看是否收到任何其他錯誤信息(假設您正在使用On Premise)。我猜你的SQL連接從你的CRM服務器到SQL數據庫有一些不太正確的地方。

+0

我會試試這個。謝謝達里爾。 – 2013-02-16 02:34:00

+0

雖然我得到的錯誤似乎是在調用服務器和CRM REST API之間的網絡層 - 而不是數據庫層。 – 2013-02-16 02:39:49

相關問題