我认为这个问题可以简化,因为它使用WebHttpBinding来托管Restful风格的服务。
在。网4.5,我们可以使用以下简化配置来托管Restful样式的服务。
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior>
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<protocolMapping>
<add binding="webHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
默认情况下,webhttpbinding使用WebHttpSecurityMode.None。因此,上面的身份验证架构错误不太可能发生。如果需要,不要忘记在IIS身份验证模块中启用身份验证模式。
尝试用我的配置替换您的配置,并在IIS站点绑定模块中提供http绑定。