2009-07-25 6 views
4

IISの下でホストされているサービスに新しいエンドポイントを追加しようとしていますが、過去1日ほどそれを把握することはできませんでした。IISの下に複数のエンドポイントがあります

これが私の理解です:

  • あなたがいる限り、彼らは独自のアドレスを持っているとして、IISの下で複数のエンドポイントを持つことができます。
  • ベースアドレスを割り当てることはできますが、IISの仮想ディレクトリの設定によって上書きされます。

私の仮想ディレクトリは、私がhttp://localhost/wcfcert/service1.svc

を使用してサービスを立ち上げることができますが、私は何をIEで何かまたはクライアントアプリ

http://localhost/wcfcert/test/service1.svc/test返さないhttp://localhost/WcfCert/

<services> 
    <service name="WcfCertServer.Service1" behaviorConfiguration="WcfCertServer.Service1Behavior"> 
    <endpoint address="" binding="wsHttpBinding" contract="WcfCertServer.IService1"/> 
    <endpoint address="test" binding="wsHttpBinding" contract="WcfCertServer.IService1"/> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
    </service> 
</services> 

ですここに行方不明?

編集:

は、だから私はさらにテストを行なったし、ここで私が発見したものです。

私がWcfTestClient.exeを起動し、http://localhost:1523/Service1.svcまたはhttp://localhost:1523/Service1.svc/mexを追加すると、そのアドレスの下に両方のエンドポイントが追加されます。だからここに私の質問http://localhost:1523/Service1.svc最初のエンドポイントを表すべきではないですか?そのアドレスを追加すると両方のエンドポイントが表示されるのはなぜですか?

が、私はhttp://localhost:1523/Service1.svc/testを追加しようとする場合、私はそれが実際だろう

Error: Cannot obtain Metadata from http://localhost:1523/Service1.svc/test If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost:1523/Service1.svc/test Metadata contains a reference that cannot be resolved: ' http://localhost:1523/Service1.svc/test '. Sendera:BadContextToken The message could not be processed. This is most likely because the action ' http://schemas.xmlsoap.org/ws/2004/09/transfer/Get ' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.HTTP GET Error URI: http://localhost:1523/Service1.svc/test There was an error downloading ' http://localhost:1523/Service1.svc/test '. The request failed with HTTP status 400: Bad Request.

+2

を、私は同様の問題を抱えている私は取得してみたいですこれに対する解決策。あなたが描写しているものとの唯一の違いは、私はテキストなしの「400 Bad Request」を得ることができます。私はhttp://msdn.microsoftの説明に従っています。com/en-us/library/ms733766.aspxには、結果のURLがあなたの例に翻訳されているというコメントが記載されています - http://localhost/wcfcert/service1.svc/test。それは私にとってもうまくいかない。 –

+0

URLはIE(.../Service1.svc/test)では機能しません。しかし、プロキシを作成することで、同じエンドポイントを追加することができます。これを参照してくださいhttp://msdn.microsoft.com/en-us/library/ms751515(v=vs.110).aspx –

答えて

2

を得る:

http://localhost/wcfcert/service1.svc/test

あなたはURLが 'http://localhost/wcfcert/test/service1.svc' になりたい場合は、あなたがする必要があります。アドレス属性に完全なURLを指定します。

+0

私は両方を試して、今私は 'HTTP 400の不正な要求を取得します。 –

+0

@ Kevan:2番目のオプションでは、address = "http://localhost/wcfcert/test/service1.svc"を設定しましたか、それともaddress = "test"のままにしましたか? URLをhttp://localhost/wcfcert/test/service1.svcにする場合は、アドレス属性に完全なアドレスを指定する必要があります。 – jrista

+0

私は、「localhost /をwcfcert /テスト/ service1.svc」とは「localhost/wcfcert/service1.svc /テスト」私は質問を編集した –

0

最近、同様の問題が発生しました.WcfTestClientがmexエンドポイントにテスト対象のサービスのメタデータを照会する必要があるためと考えています。

サービスアドレス"http://localhost:1523/Service1.svc"をWcfTestClientに追加すると、実際にエンドポイント"http://localhost:1523/Service1.svc/mex"を照会してサービスの説明を取得します。 /テスト 『/テスト/ MEX『でサービスのメタデータを取得するためのエンドポイント』エラー「WcfTestClientが探しているので"http://localhost:1523/Service1.svc/test"からメタデータを取得することはできませんが表示されている』

これを修正するには、 「/テスト」のアドレスでホストされているサービスに関するメタデータを提供するために、別のエンドポイントを追加する必要があります。これは私のために働いたソリューションです

<endpoint address="/test/mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 

関連する問題