I am getting the below error message in my WCF service. Below is my web,config. I have tried a few things and nothing has resolved the error. Any help is appreciated.
The contract ‘IMetadataExchange’ in client configuration does not
match the name in the service contract
<?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>
Have you installed the .Net Services SDK by any chance?
See: http://azure.snagy.name/blog/?tag=imetadataexchange
It sounds like it adds a client endpoint for
IMetaDataExchangein your machine.config. So you can either delete it out of your machine.config, or addto every app.config/web.config from now on.
EDIT: Note that this shouldn’t affect your actual application, it’s just a warning that you can ignore. It’s mentioned here, also: http://blogs.msdn.com/b/wcftoolsteamblog/archive/2008/08/28/tips-for-wcf-tools-in-vs2008-sp1.aspx