2010-08-12 38 views
0

当我主持在IIS Developer Express公司的“WCF 4 REST服务模板”项目(从模板)我得到以下几点:WCF 4 REST服务上的IIS Developer Express公司,身份验证问题

IIS指定的认证方案'IntegratedWindowsAuthentication,Anonymous',但绑定只支持完全一个认证方案的规范。有效的认证方案是摘要,协商,NTLM,基本或匿名。更改IIS设置,以便只使用单个身份验证方案。

我并没有改变任何配置明确等,以返回JSON不是设置automaticFormatSelectionEnabled为false:

<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开发人员表达此问题?

注:我有以下组件Microsoft.Web.dll & Microsoft.Web.Administration.dll在Web服务项目,在这里hopsting WCF服务的解决方法描述应用程序的/bin中文件夹在问题团队博客上: http://blogs.iis.net/vaidyg/archive/2010/07/21/wcf-workaround-for-webmatrix-beta.aspx

回答

2

您需要禁用不需要的身份验证方案,我猜测Windows身份验证。所以:

  1. 启动记事本
  2. 用记事本打开文件:%USERPROFILE%\文件\ IISExpress8 \ CONFIG \对ApplicationHost.config
  3. 搜索< windowsAuthentication
  4. 变化从 真到假enabled属性
  5. 保存

这将禁用所有站点的Windows身份验证S,你可以或者在文件底部的最后< /配置前添加一个位置路径>为特定站点(YourSite在这种情况下)行添加:

<location path="YourSite" overrideMode="Allow"> 
    <system.webServer> 
     <security> 
      <windowsAuthentication enabled="false" /> 
     </security> 
    </system.webServer> 
</location> 

这只会禁用的特定的网站。