2
我從調用WCF服務的ASPX頁面收到以下錯誤消息。未經授權的客戶端身份驗證方案NTLM
HTTP請求是未經授權的客戶端身份驗證方案NTLM'。從服務器收到的驗證頭是'NTLM'。
我在一個負載均衡的web服務器環境,以及只有獲得當客戶端ASPX頁面被擊中WCF服務(也負載平衡的Web服務器上)上相同錯誤服務器。
例如:在服務器A上
ASPX頁面 - > WCF服務的服務器B =沒有問題。
服務器B上的ASPX頁面 - >服務器上的WCF服務C =沒有問題。
服務器B上的ASPX頁面 - >服務器B上的WCF服務=上面的錯誤。
服務器是IIS 7.5,WCF服務當前配置有作爲網絡服務帳戶運行的匿名和Windows身份驗證。
這是否與環回保護有關?我目前無法將這些結果複製到應用程序和服務託管在同一臺計算機上的單個服務器環境中。
這裏是我的ASPX頁面綁定和服務:
客戶:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Imyservice">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://loadbalancedserver/myservice/myservice.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Imyservice"
contract="myservice.Imyservice" name="BasicHttpBinding_Imyservice" />
</client>
</system.serviceModel>
WCF服務:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="myservice.Service.myservice">
<endpoint address="" bindingNamespace="http://services.company.net/myservice"
binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding"
contract="myservice.Imyservice" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>