.net - 在哪里启用元数据(在配置中启用)?

标签 .net wcf web-services exception-handling mex

我有一个基本的 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>

除此之外,我没有更改代码中其他任何地方的任何元数据设置。

我在哪里可以启用元数据来修复错误?

最佳答案

您需要将元数据交换 (MEX) 端点添加到您的服务节点。尝试这样的事情:

<endpoint 
    address="http://host/svc/mex" 
    binding="mexHttpBinding" 
    bindingConfiguration=""
    contract="IMetadataExchange"/>

关于.net - 在哪里启用元数据(在配置中启用)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1546716/

相关文章:

java - 在 Mirth 自定义 Web 服务中获取目的地响应

web-services - 如何使用 Fiddler 捕获非浏览器数据

c# - 返回嵌套的泛型 Expression<Func<T, bool>>

.net - 快速获取群组成员资格

android - 发布 XML 请求和 XML 响应 Volley 库

c# - 如何使用配置在 WCF 客户端上设置用户名/密码?

web-services - Google App Engine 上的 RESTful Web 服务

c# - 我可以在 .NET Standard 类库中使用动态吗?

.net - 我应该如何优化 .net 代码中对一个简单存储过程的多次调用?

c# - 中间层的 WCF 托管