【发布时间】:2010-11-29 01:21:27
【问题描述】:
我有两个网站托管在同一个 IIS 服务器上。 SiteA 包含 SiteB 需要访问的 WCF 服务,以及在域上经过身份验证的任何其他服务。
该服务配置了 wsHttpBinding,因此我相信默认情况下使用 Windows 安全性。现在,我可以从本地计算机上运行的控制台应用程序以及默认 Visual Studio Web 服务器中运行的 Web 应用程序调用服务,因此我认为身份验证正在工作。
但是,当 SiteB 尝试访问服务时,它会失败并出现以下错误: 调用者未通过服务的身份验证。
SiteB 与 SiteA 在同一台机器上运行,所以我不明白为什么它无法通过身份验证。 SiteB 使用表单身份验证,我将匿名访问映射到域用户。
这里是配置位:
站点 A(服务):
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service behaviorConfiguration="wcfServiceBehaviour" name="MyService">
<endpoint address="" binding="wsHttpBinding" contract="IServiceContract" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="wcfServiceBehaviour">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
SiteB(客户端):
<system.serviceModel>
<client>
<endpoint address="http://xxxxx/Services/xxService.svc"
binding="wsHttpBinding"
contract="IServiceContract" />
</client>
</system.serviceModel>
【问题讨论】:
-
嗨 Xavier,我很抱歉,我错了。我显然错过了这一点。
标签: wcf wcf-binding windows-authentication