远程端点失败 - 随机发生

问题描述:

我们有一个网站设置,该网站使用WCF与我们的Microsoft CRM 2011解决方案进行通信。远程端点失败 - 随机发生

用户在我们的网站上创建新案例,这些案例存储在CRM解决方案中。使用WCF,它调用CRM并存储数据。

这很好,但每天几次会出现下面的错误。我们无法找到这些事件的独特之处:随机用户,随机输入等。对于出现错误的用户来说,没有什么是独一无二的。

我们可以在我们的IIS事件查看器中看到每天发生错误~3次,具体取决于我们有多少在线用户。

任何想法?什么是独特的?提示?什么东西? :-) 谢谢!

错误

Exception information: 
    Exception type: SecurityNegotiationException 
    Exception message: Secure channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or implied by the EndpointAddress correctly identifies the remote endpoint. 

Server stack trace: 
    at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout) 
    at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade) 
    at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

我们的设置:

我们有1所制作的网站服务器和CRM服务器。没有负载平衡器或其他任何东西。

WCF结合

<system.serviceModel> 
     <bindings> 
      <customBinding> 
       <binding name="CustomBinding_IOrganizationService"> 
        <security defaultAlgorithmSuite="Default" authenticationMode="SspiNegotiated" 
         requireDerivedKeys="true" securityHeaderLayout="Strict" includeTimestamp="true" 
         keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature" 
         messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" 
         requireSecurityContextCancellation="true" requireSignatureConfirmation="false"> 
         <localClientSettings cacheCookies="true" detectReplays="true" 
          replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite" 
          replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00" 
          sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true" 
          timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" /> 
         <localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00" 
          maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00" 
          negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00" 
          sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00" 
          reconnectTransportOnFailure="true" maxPendingSessions="128" 
          maxCachedCookies="1000" timestampValidityDuration="00:05:00" /> 
         <secureConversationBootstrap /> 
        </security> 
        <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" 
         messageVersion="Default" writeEncoding="utf-8"> 
         <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
          maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
        </textMessageEncoding> 
        <httpTransport manualAddressing="false" maxBufferPoolSize="524288" 
         maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous" 
         bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard" 
         keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous" 
         realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" 
         useDefaultWebProxy="true" /> 
       </binding> 
       <binding name="CustomBinding_IOrganizationService1"> 
        <security defaultAlgorithmSuite="Default" authenticationMode="SspiNegotiated" 
         requireDerivedKeys="true" securityHeaderLayout="Strict" includeTimestamp="true" 
         keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature" 
         messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" 
         requireSecurityContextCancellation="true" requireSignatureConfirmation="false"> 
         <localClientSettings cacheCookies="true" detectReplays="true" 
          replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite" 
          replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00" 
          sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true" 
          timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" /> 
         <localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00" 
          maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00" 
          negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00" 
          sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00" 
          reconnectTransportOnFailure="true" maxPendingSessions="128" 
          maxCachedCookies="1000" timestampValidityDuration="00:05:00" /> 
         <secureConversationBootstrap /> 
        </security> 
        <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" 
         messageVersion="Default" writeEncoding="utf-8"> 
         <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
          maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
        </textMessageEncoding> 
        <httpTransport manualAddressing="false" maxBufferPoolSize="524288" 
         maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous" 
         bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard" 
         keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous" 
         realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" 
         useDefaultWebProxy="true" /> 
       </binding> 
      </customBinding> 
     </bindings> 
     <client> 
      <endpoint address="http://OURDOMAIN/XRMServices/2011/Organization.svc" 
       binding="customBinding" bindingConfiguration="CustomBinding_IOrganizationService" 
       contract="CRMService.IOrganizationService" name="CustomBinding_IOrganizationService"> 
       <identity> 
        <servicePrincipalName value="host/OURDOMAIN" /> 
       </identity> 
      </endpoint> 
      <endpoint address="http://OURDOMAIN/XRMServices/2011/Organization.svc" 
       binding="customBinding" bindingConfiguration="CustomBinding_IOrganizationService1" 
       contract="XRMService.IOrganizationService" name="CustomBinding_IOrganizationService1"> 
       <identity> 
        <servicePrincipalName value="host/OURDOMAIN" /> 
       </identity> 
      </endpoint> 
     </client> 
    </system.serviceModel> 
+0

我建议张贴一些代码来展示如何实例化CRM服务 - 您的问题可能不在于配置。 –

答案很有意思。我们发现我们公司的一个团队不时对我们的CRM系统进行了一些极其严格的测试。这阻止了我们的电话,导致超时。

这也可以解释行为的随机性。

我们发现通过在计算机上启用跟踪功能,可以看到性能图。