WCF 暴露元数据的配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.servicemodel>
    <services>
      <service name="EssentialWCF.StockService" behaviorConfiguration="myServiceBehavior">
        <host>
          <baseaddresses>
            <add baseaddress="http://localhost:8000/EssentialWCF" />
          </baseaddresses>
        </host>
        <endpoint address="" binding="basicHttpBinding" contract="EssentialWCF.IStockService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="myServiceBehavior">
          <serviceMetadata httpGetEnabled="True" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.servicemodel>
</configuration>
原文地址:https://www.cnblogs.com/pnljs/p/3088086.html