【问题标题】:WCF Metadata publishing for this service is currently disabled此服务的 WCF 元数据发布当前已禁用
【发布时间】:2011-11-16 05:18:43
【问题描述】:

我在使用 WCF 时难以显示元数据。

我到处找。我不确定这是否是我的 web.config 文件中的设置,或者我的实际服务无法正常工作。但我收到“此服务的元数据发布当前已禁用”。调试时的页面。

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="myWebHttp"/>
      </webHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="EDSCoastmap">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webHttp">
          <webHttp/>
        </behavior>
        <behavior name="jsonWebHttp">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="EDSCoastmap" name="EDS_CoastmapRest.EDSCoastmap">
        <endpoint behaviorConfiguration="webHttp" binding="webHttpBinding"
          bindingConfiguration="myWebHttp" contract="EDS_CoastmapRest.IEDSCoastmap" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
  </system.web>
</configuration>

【问题讨论】:

    标签: wcf web metadata config


    【解决方案1】:

    您的服务没有 SOAP 端点,因此没有要公开的有效元数据。如果您没有 SOAP 服务,则不需要 serviceMetadata 行为或 MEX 端点。

    顺便说一句。如何调试服务?

    【讨论】:

    • 我正在尝试创建一个休息服务。不幸的是,我正在构建一个最初创建的肥皂服务。
    • WCF 中的 REST 服务没有像 WSDL 这样的描述,所以也不需要元数据发布。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    相关资源
    最近更新 更多