2011-07-14 58 views
0

我正在開發具有雙工通信的WCF服務,並且遇到了一個問題,使得它無法通過我的開發機器上的本地主機進行工作。WCF雙工服務中的SOAP安全協商錯誤

不管我做什麼,它自帶了以下錯誤:

{"Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity 'host/crpnyciis20e'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress for the server."}

我服務的Web.config如下:

<?xml version="1.0"?> 
<configuration>  
    <system.web> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
    <protocolMapping> 
     <add scheme="http" binding="wsDualHttpBinding"/> 
    </protocolMapping> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
</configuration> 

而我的客戶的App.config中:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 
     <bindings> 
      <wsDualHttpBinding> 
       <binding name="WSDualHttpBinding_IMessagingService" closeTimeout="00:01:00" 
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
        maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
        messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"> 
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
         maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
        <reliableSession ordered="true" inactivityTimeout="00:10:00" /> 
        <security mode="Message"> 
         <message clientCredentialType="Windows" negotiateServiceCredential="true" 
          algorithmSuite="Default" /> 
        </security> 
       </binding> 
      </wsDualHttpBinding> 
     </bindings> 
     <client> 
      <endpoint 
       binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IMessagingService" 
       contract="CTMessagingServiceReference.IMessagingService" name="WSDualHttpBinding_IMessagingService"> 
       <identity> 
        <userPrincipalName value="nbdfp2k" /> 
       </identity> 
      </endpoint> 
     </client> 
    </system.serviceModel> 
</configuration> 

任何想法我能做些什麼來解決這個問題?如果有任何其他代碼可以幫助診斷,請讓我知道......其餘的其他代碼都不需要連接配置,我知道的。

+0

是您在Active Directory域中的計算機?用戶是否從該域連接到您的服務? –

+0

是的,它在AD上。 Web服務當前正在服務用戶帳戶下的DEV IIS框上運行。 –

+0

並且是服務域帳戶的'nbdfp2k'名稱? –

回答

1

不確定這是否會解決您的問題,但是您在客戶端端點中丟失了地址,並且在綁定配置中也丟失了clientbase地址(它應該與您的端點地址不同)。

0

不知道這是做它的理想方式,但你可以嘗試從客戶端配置刪除以下「身份」節點 -

<identity> 
    <userPrincipalName value="nbdfp2k" /> 
</identity>