Доброе время суток уважаемые форумчане. Обращаюсь к Вам с такой проблемой. Раз в сутки выполняется консольное приложение, которое обновляет данные в CRM (2011). Код примерно такой:
X++:
ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
Uri uri = new Uri("http://localhost:5555/rbrcrm/XRMServices/2011/Organization.svc");
OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credentials, null);
// This statement is required to enable early-bound type support.
proxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
IOrganizationService service = (IOrganizationService)proxy;
...
Entity vCon = new Entity("contact");
...
service.Update(vCon);
...
service.Update(vCon) - выполняется в цикле.
Приложение обычно выполняется около 3х часов. Примерно в 70% программа вылетает с ошибкой, спустя значительное время после выполнения, на строке service.Update(vCon);
Причем, судя по логам, программа пытается выполнить эту строчку минут 30-40, потом выходит сообщение об ошибке:
X++:
System.ServiceModel.Security.MessageSecurityException: . . . ---> System.ServiceModel.FaultException: . .
--- ---
Server stack trace:
System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(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)
Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity)
Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)
Есть дни, когда весь процесс проходит без ошибок (около 30%).
Прошу помощи в решении проблемы.