我有两个网站托管在同一个IIS服务器上。 SiteA包含需要由SiteB访问的WCF服务,以及在域中进行身份验证的任何其他服务。配置WCF安全(wsHttpBinding)
服务配置了的wsHttpBinding,因此我相信,在默认情况下使用Windows的安全性。现在我可以从本地机器上运行的控制台应用程序调用服务,也可以从运行在默认Visual Studio Web服务器中的Web应用程序调用服务,所以我认为该认证正在工作。
但是,当SiteB尝试访问服务时,它会失败,并显示以下错误: 调用者未被服务验证。
网站B在同一台机器不是站点A上运行,所以我不明白为什么它不能进行身份验证。 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>
网站B(客户端):
<system.serviceModel>
<client>
<endpoint address="http://xxxxx/Services/xxService.svc"
binding="wsHttpBinding"
contract="IServiceContract" />
</client>
</system.serviceModel>
泽维尔嗨,我的道歉,我错了。我显然错过了这一点。 – Aliostad 2010-11-29 09:23:56