同じIISサーバー上に2つのWebサイトがホストされています。 SiteAには、SiteBがアクセスする必要があるWCFサービスと、ドメインで認証されたその他のサービスが含まれています。WCFセキュリティの設定(wsHttpBinding)
サービスは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の(クライアント): - WCFで設定wsHttpBinding
<system.serviceModel>
<client>
<endpoint address="http://xxxxx/Services/xxService.svc"
binding="wsHttpBinding"
contract="IServiceContract" />
</client>
</system.serviceModel>
こんにちはザビエル、私の謝罪を、私は間違っていました。私は明らかにこのビットを見逃していた。 – Aliostad