我想创建一个托管在 IIS 7.5 中的 WCF 服务,并且我想通过 http 使用摘要身份验证。
我在虚拟目录上有设置摘要,但是当我尝试访问该服务时,我总是收到错误:
此服务需要“匿名”身份验证,但托管此服务的 IIS 应用程序未启用它
这是我的 web.config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_IServisTest">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Digest"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="ServisService.ServisTest"
behaviorConfiguration="ServisService.ServisTestBehavior">
<endpoint
address=""
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IServisTest"
contract="ServisService.IServistest" >
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServisService.ServisTestBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
我使用的是 http 而不是 https。