我正在尝试创建WCF服务,但出现以下错误。错误:此服务的安全服务需要匿名身份验证。我发现了类似的问题,但是他们的解决方案对我不起作用。
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="CMSUI.DataServiceAspNetAjaxBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service name="CMSUI.DataService" >
<endpoint address="" behaviorConfiguration="CMSUI.DataServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="CMSUI.DataService" />
</service>
</services>
谢谢您的帮助。
我暂时在iis中启用了匿名访问,并在web.config中禁用了匿名访问。它解决了我的问题。
web.config
<authorization>
<deny users="?" />
<allow users="*"/>
</authorization>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句