4 つのエンドポイントが定義されたサービスがあり、構成は次のようになります。
<service name="Systembolaget.Services.ButikService" behaviorConfiguration="default">
<endpoint
address="xml"
binding="webHttpBinding"
behaviorConfiguration="xml"
contract="Systembolaget.Contracts.Butiker.IButikService" />
<endpoint
address="json"
binding="webHttpBinding"
behaviorConfiguration="json"
contract="Systembolaget.Contracts.Butiker.IButikService" />
<endpoint
address="soap"
binding="basicHttpBinding"
contract="Systembolaget.Contracts.Butiker.IButikService"
bindingConfiguration="default"/>
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
<behaviors>
<endpointBehaviors>
<behavior name="xml">
<webHttp defaultOutgoingResponseFormat="Xml" defaultBodyStyle="Bare"></webHttp>
</behavior>
<behavior name="json">
<webHttp defaultOutgoingResponseFormat="Json" defaultBodyStyle="Bare"></webHttp>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="default">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
エンドポイントのいずれかでサービスを使用すると、すべて正常に機能します。ただし、xml と json の両方のエンドポイントが存在する場合、Visual Studio 2012 でテスト クライアントを使用できません。どちらか一方をコメントアウトすると、クライアントは機能しますが、構成ファイルに両方を保持すると、次のエラーが発生します。
http://localhost:52832/VarugruppService.svc
エラー:アクセスできる Windows (R) Communication Foundation サービスの場合は、メタデータを取得できません。指定されたアドレスでのメタデータ公開が有効になっていることを確認してください。メタデータの公開を有効にする方法については、http://go.microsoft.com/fwlink/?LinkId=65455
.WS-Metadata Exchange
URI:http://localhost:52832/VarugruppService.svc
Metadata contains a reference that cannot be resolve: にある MSDN ドキュメントを参照してくださいhttp://localhost:52832/VarugruppService.svc
。メッセージを受け入れることができる
リッスンしているエンドポイントがありませんでした。http://localhost:52832/VarugruppService.svc
これは、多くの場合、アドレスまたは SOAP アクションが正しくないことが原因です。詳細については、InnerException (存在する場合) を参照してください。
リモート サーバーがエラーを返しました: (404) Not Found.HTTP GET エラー
URI:http://localhost:52832/VarugruppService.svc
' ' のダウンロード中にエラーが発生しましたhttp://localhost:52832/VarugruppService.svc
。
リクエストは HTTP ステータス 404: Not Found で失敗しました。
何か案は?