zoukankan      html  css  js  c++  java
  • WCF

    1. 在服务 Transfer 实现的协定列表中找不到协定名称 "IMetadataExchange"

    将 ServiceMetadataBehavior 添加到配置文件或直接添加到 ServiceHost,以启用对该协定的支持

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
      </startup>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="exposeExceptionDetail">
              <serviceMetadata />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <netTcpBinding>
            <binding name="NetTcpBinding_ITransfer">
              <security mode="None"/>
            </binding>
          </netTcpBinding>
        </bindings>    
        <services>
          <service name="TestWcfScreen.Transfer"
                   behaviorConfiguration="exposeExceptionDetail">
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:8733/Transfer/" />
              </baseAddresses>
            </host>
            <endpoint address="" 
                      binding="netTcpBinding" 
                      bindingConfiguration="NetTcpBinding_ITransfer"
                      contract="TestWcfScreen.ITransfer">
            </endpoint>
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
          </service>
        </services>
      </system.serviceModel>
    </configuration>

    忘记添加 <serviceMetadata /> 这个标签

  • 相关阅读:
    Python Scrapy框架
    Python Mongo数据库
    Python Selenium框架
    Python BeautifulSoup库使用
    Python 存入三大文件
    Python Xpath的解析,应用
    Python Requests 高级
    错误码:2003 不能连接到 MySQL 服务器在 (10061)
    MySQL连接本地数据库时报1045错误的解决方法
    iWebShop安装教程
  • 原文地址:https://www.cnblogs.com/androllen/p/6911369.html
Copyright © 2011-2022 走看看