【发布时间】:2010-12-02 11:55:58
【问题描述】:
我有以下问题。在我的机器上,我有一个 SL 3 应用程序,它基本上包括:
* 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 应用程序未启用。
我尝试将<transport clientCredentialType="Windows" /> 添加到 basicHttpBinding 的安全性中,但 VS 给了我警告“未声明 'clientCredentialType' 属性。”。
如果有人能帮我解决这个问题,我将不胜感激。
【问题讨论】:
标签: wcf iis silverlight-3.0