IMetadataExchange WCF配置错误

本文关键字:错误 配置 WCF IMetadataExchange | 更新日期: 2023-09-27 18:11:39

我在WCF服务中得到以下错误消息。下面是我的网页,配置。我已经尝试了一些事情,没有解决错误。如有任何帮助,不胜感激。

客户端配置中的合约'IMetadataExchange'没有匹配服务契约中的名称

<?xml version="1.0"?>
<configuration>
 <connectionStrings/>
   <system.web>
     <compilation strict="false" explicit="true" targetFramework="4.0" debug="true"/>
   </system.web>
<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <basicHttpBinding>
    <binding name="SNCBinding" closeTimeout="00:10:00" openTimeout="00:10:00"
      receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647"
      maxReceivedMessageSize="2147483647" textEncoding="utf-8">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows" proxyCredentialType="Windows" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
  multipleSiteBindingsEnabled="true" />
<services>
  <service name="SNC.MaterialRequest.WCF.MaterialRequest">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="SNCBinding"
      contract="SNC.MaterialRequest.WCF.MaterialRequest" />
  </service>
</services>
 </system.serviceModel>
 </configuration>

IMetadataExchange WCF配置错误

您是否安装了。net Services SDK ?

见:http://azure.snagy.name/blog/?tag=imetadataexchange

听起来像是在machine.config中为IMetaDataExchange添加了一个客户端端点。所以你可以把它从你的电脑中删除。配置或添加

<client>
  <remove contract=”IMetadataExchange” name=”sb” />
</client>

到每个app.config/web。从现在开始配置

EDIT:请注意,这应该不会影响您的实际应用程序,它只是一个可以忽略的警告。这里也提到了:http://blogs.msdn.com/b/wcftoolsteamblog/archive/2008/08/28/tips-for-wcf-tools-in-vs2008-sp1.aspx

问题是:

contract="SNC.MaterialRequest.WCF.MaterialRequest"

与IMetadataExchange错误不一样。所以它要么在服务器端配置错误,要么在客户端配置错误。虽然我会说在服务器端,因为这应该是接口。