1

C# の wcf に問題があります。「メタデータを取得できません」というエラー メッセージが表示されます。ここで同様の投稿をグーグルでチェックしようとしましたが、何が悪いのかわかりません。ここに私のApp.configファイルがあります:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="SearchService.PersonServiceBehavior">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service behaviorConfiguration="SearchService.PersonServiceBehavior"
            name="SearchService.PersonService">
            <endpoint address="" binding="basicHttpBinding" bindingConfiguration="" contract="SearchService.IPersonService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
                <baseAddresses>
                    <add baseAddress="http://localhost:8731/Design_Time_Addresses/SearchService/PersonService/" />
                </baseAddresses>
            </host>
        </service>
    </services>
</system.serviceModel>

誰かが修正を見つけたり、正しい方向に導いてくれたりしたら、とても幸せです:)

4

1 に答える 1

0

少し前に同様の問題がありました。構成ファイルを見ると、WebBehavior を使用していることが唯一の違いです (以下を参照してください)。

<system.serviceModel>
<services>
  <service behaviorConfiguration="ServiceBehaviour" name="MyCRMServiceHost.MyCRMService">
    <endpoint address="/imo" behaviorConfiguration="webBehavior"
      binding="webHttpBinding" name="IMOEndpoint" contract="MyCRMServiceHost.IGenerateIMO" />
    <endpoint address="mex" binding="mexHttpBinding" name="MEXEndpoint"
      contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="webBehavior">
      <webHttp />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehaviour">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

</system.serviceModel>
于 2013-05-17T14:51:56.947 に答える