【发布时间】:2011-03-28 21:29:36
【问题描述】:
当我在 IIS Developer Express 中托管 “WCF 4 Rest Service Template” 项目(来自模板)时,我得到以下信息:
IIS 指定了身份验证方案“IntegratedWindowsAuthentication, Anonymous”,但绑定只支持指定一个身份验证方案。有效的身份验证方案是 Digest、Negotiate、NTLM、Basic 或 Anonymous。更改 IIS 设置,以便只使用一个身份验证方案。
除了将 automaticFormatSelectionEnabled 设置为 false 以返回 JSON 之外,我没有显式更改任何配置:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<!--Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below-->
<standardEndpoint name=""
helpEnabled="true"
automaticFormatSelectionEnabled="false"
/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
如果端点配置未明确设置是问题,那么我将如何为此类服务执行此操作,以便明确设置服务的身份验证方案以避免 iis developer express 出现此问题?
注意:我在 Web 服务项目 /bin 中有以下程序集 Microsoft.Web.dll 和 Microsoft.Web.Administration.dll > 应用程序的文件夹,如 iss 团队博客上用于跳入 WCF 服务的解决方法中所述: http://blogs.iis.net/vaidyg/archive/2010/07/21/wcf-workaround-for-webmatrix-beta.aspx
【问题讨论】:
标签: wcf iis-7 .net-4.0 wcf-rest wcf-configuration