2012-01-26 13 views
0

私のサービスにMEXエンドポイントを追加しようとしています。私がサービスを開始すると、私は取得していますWCF MEXエンドポイント

WCFサービスホストはサービスメタデータを見つけることができません。これにより、 クライアントアプリケーションが に正しく実行されなくなる可能性があります。メタデータが有効になっているかどうか確認してください。 を終了しますか?

ここに私の設定ファイルです:私はまだメッセージが出ていますなぜ

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 

    <system.web> 
    <compilation debug="true" /> 
    </system.web> 

    <system.serviceModel> 
    <services> 
     <service name="WcfServiceLibrary1.CustomerService" 
       behaviorConfiguration="Metadata"> 

     <endpoint address="" 
        binding="wsHttpBinding" 
        contract="WcfServiceLibrary1.IService1"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 

     <endpoint address="mex" 
        binding="mexHttpBinding" 
        contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8000" /> 
      </baseAddresses> 
     </host> 

     </service> 
    </services> 

    <behaviors> 
     <serviceBehaviors> 
     <behavior name="Metadata"> 
      <serviceMetadata httpGetEnabled="true" /> 
     </behavior> 
     <behavior> 
      <serviceMetadata httpGetEnabled="True"/> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

</configuration> 

誰もが知っていますか?

おかげ

+1

「私はサービスを開始するときに、」あなたは何を意味するのですか?どのようにサービスをホストしていますか:自己ホスティング、IIS、またはVisual Studioのホストを使用していますか? –

答えて

0

あなたはMEXエンドポイントとhttpGetEnabledを指定する必要はありません。 1つだけがメタデータを公開する必要があります。 httpGetUrlはホスティング環境に応じて指定しないでください。

はこれを試してください。..

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 

    <system.web> 
    <compilation debug="true" /> 
    </system.web> 

    <system.serviceModel> 
    <services> 
     <service name="WcfServiceLibrary1.CustomerService" 
       behaviorConfiguration="Metadata"> 

     <endpoint address="" 
        binding="wsHttpBinding" 
        contract="WcfServiceLibrary1.IService1"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 

     <endpoint address="mex" 
        binding="mexHttpBinding" 
        contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8000" /> 
      </baseAddresses> 
     </host> 

     </service> 
    </services> 
    </system.serviceModel> 

</configuration> 
関連する問題