当我在 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