【问题标题】:Remote endpoint has failed - happens randomly远程端点失败 - 随机发生
【发布时间】:2012-09-05 11:38:20
【问题描述】:

我们有一个网站设置,该网站使用 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>

【问题讨论】:

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

标签: .net wcf dynamics-crm-2011 wcf-security


【解决方案1】:

答案很有趣。我们发现我们公司的一个团队不时对我们的 CRM 系统进行一些极其繁重的测试。这阻止了我们的通话并导致超时。

这也可以解释动作的随机性。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-25
    • 1970-01-01
    • 2017-04-19
    • 1970-01-01
    • 2010-10-04
    • 2014-11-19
    • 2021-08-24
    相关资源
    最近更新 更多