2009-09-11 107 views
0

每當我嘗試使用通過WCF我的web服務,我收到此錯誤:另 - HTTP請求是未經授權的錯誤

The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLMnProviders'. 

我知道我正確的有Kerberos設置此環境(它調用的SharePoint 3.0服務我用於其他應用程序)。集成的Windows安全性一直很好,但這是我第一次嘗試通過WCF使用它。

我已經多次通過這個site以確保我有正確的標題。上述錯誤是否因爲期待「協商」而失敗,但它正在接收「Negotiate,NTLMnProviders」?我知道我可以通過該網站更改我的標題,但它始終具有Kerberos標題的「Negotiate,NTLMnProviders」。任何人有任何想法?

+0

告訴我們您服務和客戶端配置!你使用什麼綁定?什麼安全設置?沒有相關信息,我們不能回答這樣的問題....... – 2009-09-13 06:56:16

回答

0

不是一個真正的答案,但這裏有一些更多的細節......

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="ListsSoap"> 
      <security mode="TransportCredentialOnly"> 
      <transport clientCredentialType="Windows" proxyCredentialType="Windows"/> 
      </security>   
     </binding> 
     <binding name="SiteDataSoap"> 
      <security mode="TransportCredentialOnly"> 
      <transport clientCredentialType="Windows" proxyCredentialType="Windows"/> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://something.com/_vti_bin/lists.asmx" 
      binding="basicHttpBinding" bindingConfiguration="ListsSoap" 
      contract="WSS_Server.ListsSoap" name="ListsSoap"> 
     <identity> 
      <dns value="localhost" /> 
     </identity> 
     </endpoint> 
     <endpoint address="http://something.com/_vti_bin/SiteData.asmx" 
      binding="basicHttpBinding" bindingConfiguration="SiteDataSoap" 
      contract="WSS_Server_SiteData.SiteDataSoap" name="SiteDataSoap"> 
     <identity> 
      <dns value="localhost" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

然後我實例化我的代理,並在代碼中調用此...

proxy.ClientCredentials.Windows.AllowedImpersonationLevel = 
       System.Security.Principal.TokenImpersonationLevel.Impersonation; 

proxy.ClientCredentials.Windows.AllowNtlm = false; 

// Web service call 
proxy.GetWeb(...);