【发布时间】:2012-02-25 03:21:32
【问题描述】:
我已经编写了我的第一个 WCF Web 服务,它在我自己的本地测试网络服务器上运行良好,但是当我将它部署到 IIS 时出现错误。
我们的 IIS 服务器使用集成身份验证,并且不允许 允许匿名访问。从what I've read,我需要将绑定的安全模式设置为TransportCredentialOnly。 web.config 中的整个部分是:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="VZW.TrainingPortfolioManager.Website.TPMAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="VZW.TrainingPortfolioManager.Website.TPM">
<endpoint address="" behaviorConfiguration="VZW.TrainingPortfolioManager.Website.TPMAspNetAjaxBehavior"
binding="webHttpBinding" contract="VZW.TrainingPortfolioManager.Website.TPM" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding>
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
但是,当我在浏览器中加载 Web 服务时,我收到错误消息:
Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
还有什么我需要更改或配置才能使其正常工作的吗?
【问题讨论】: