3

私は基本的な wcf サービスを持っていますが、それをテストするために wcfctestclient に移動すると、メタデータが見つからないというエラーが表示されます。追加してください。残念ながら、エラー ポップアップの MSDN リンクが壊れており、私の WCF サービスの app.configメタデータが有効になっています:

  <serviceBehaviors>
    <behavior name="TelerikWcfServices.Service1Behavior">
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="True"/>
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true.  Set to false before deployment 
      to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>

それ以外は、コードの他の場所でメタデータ設定を変更していません。

メタデータを有効にしてエラーを修正できる場所はどこですか?

4

3 に答える 3

3

メタデータ交換 (MEX) エンドポイントをサービス ノードに追加する必要があります。次のようなことを試してください:

<endpoint 
    address="http://host/svc/mex" 
    binding="mexHttpBinding" 
    bindingConfiguration=""
    contract="IMetadataExchange"/>
于 2009-10-10T01:31:56.977 に答える
1

WorkflowServiceHost でワークフロー 4.0 を使用し、xamlx リソースからサービスをロードしている場合、名前付きの WCF serviceBehavior タグが認識されません。理由はわかりません(私にはバグのようです)。たとえば、上記のタグ:

<serviceBehaviors>
    <behavior name="TelerikWcfServices.Service1Behavior">
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>

次のように name 属性を削除する必要があります。

<serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>

サービス要素は、次のように動作構成名への参照を削除します。

<service 
    name="TelerikWcfServices.IScheduler">
    <endpoint address="http://localhost/Telerik" binding="basicHttpBinding"
      bindingConfiguration="" name="Telerik"      contract="TelerikWcfServices.IScheduler">...
于 2014-03-19T18:10:18.770 に答える
0

ファイル全体を表示する唯一の簡単な方法であるため、私は自分の質問に答えました。

<client>
  <endpoint address="http://localhost/Telerik" binding="basicHttpBinding"
    bindingConfiguration="" contract="TelerikWcfServices.IScheduler"
    name="Telerik">
    <identity>
      <dns value="localhost" />
      <certificateReference storeName="My" storeLocation="LocalMachine"
        x509FindType="FindBySubjectDistinguishedName" />
    </identity>
  </endpoint>
</client>
<diagnostics>
  <messageLogging logEntireMessage="true" />
</diagnostics>
<services>
  <service behaviorConfiguration="TelerikWcfServices.Service1Behavior"
    name="TelerikWcfServices.IScheduler">
    <endpoint address="http://localhost/Telerik" binding="basicHttpBinding"
      bindingConfiguration="" name="Telerik" contract="TelerikWcfServices.IScheduler">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8731/Design_Time_Addresses/TelerikWcfServices/Service1/" />
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="TelerikWcfServices.Service1Behavior">
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="True"/>
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true.  Set to false before deployment 
      to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>

ご助力いただきありがとうございます!

于 2009-10-10T01:33:32.973 に答える