我有以下问题。在我的机器我有一个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'属性没有声明。”
如果有人能帮助我,我将非常感激。