我有以下問題。在我的機器我有一個SL 3應用程序,基本上包括:Silverlight 3 + WCF和IIS基本認證
* Client app (SL)
* Web app (.Net 3.5)
* Communication with the database handled by WCF
該網站上我的IIS託管,用下面的驗證設置:
* Anonymous access: off
* Basic authentication: on
* Integrated Windows authentication: on
我的綁定設置爲如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="TransportCredentialOnly" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/MyApp/WCFPortal.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IWcfPortal" contract="WcfPortal.IWcfPortal"
name="BasicHttpBinding_IWcfPortal" />
</client>
</system.serviceModel>
</configuration>
Web.config文件:
<authentication mode="Windows" />
<identity impersonate="true" />
當我導航到我的網站時,系統提示輸入用戶名和密碼。如果填寫正確,我可以訪問該站點,但數據庫通信不起作用。當我轉到localhost/MyApp/WcfPortal.svc時,出現以下錯誤:
此服務的安全設置需要「匿名」身份驗證,但未啓用承載此服務的IIS應用程序。
我試着在basicHttpBinding中加入<transport clientCredentialType="Windows" />
來安全,但是VS給了我警告「'clientCredentialType'屬性沒有聲明。」
如果有人能幫助我,我將非常感激。