匿名認証で WCF サービスを作成しようとしています。現在のドメインにない宛先サーバーにサービスをデプロイすると、サービスを呼び出そうとすると次のエラーが表示されます。
コンテンツ タイプ application/soap+xml; charset=utf-8 は、サービスhttp://myserver.com/page.svcでサポートされていませんでした。クライアントとサービスのバインディングが一致していない可能性があります。
現在のところ、サービスの web.config ファイルに次のセクションがあります。
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>
さまざまなバインディング (wsHttpBinding および basicHttpBinding) を試していますが、上記のエラー (basicHttpBinding を使用) または「アクセスが拒否されました」というメッセージ (wsHttpBinding を使用) を受け取ります。これは、wsHttpBinding を使用するときに使用しようとした web.config セクションです。
<system.serviceModel>
<services>
<service behaviorConfiguration="AMP.MainBehavior" name="AMP.Main">
<endpoint address="" binding="wsHttpBinding" contract="AMP.IMain">
<identity>
<dns value="myservice.com"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="AMP.MainBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
このサービスは、.NET 4.0 フレームワークで作成されています。匿名にする必要がありますが、何が欠けているのかわかりません。私はWCFを初めて使用するので、まだすべてのアヒルを続けているわけではありません。
ありがとうございました、