tags:

views:

28

answers:

2

I have searched the web for resolution of this error, but everything I have found suggests what I have is correct.

Maybe someone could take a look and spot an obvious mistake I just cannot see.

I have a windows service, hosting two contracts:

  1. IConfigurationService
  2. IConfigurationAdminService

The admin service inherits from the standard service as I want both contracts to implement the basic methods.

The problem is I can host the services fine, until I try and add a MEX.

Then I get the following exception:

The contract name 'IMetaDataExchange' could not be found in the list of contracts implemented by the service 'ConfigurationWCFService'.

And this is my config, everything is configured by config, nothing done through code.

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="tcpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="serviceBehavior" name="BrightsideGroup.Repa.Configuration.ConfigurationWCFService">
        <endpoint address="ConfigurationService" binding="netTcpBinding"
          bindingConfiguration="tcpBinding" name="tcpConfiguration" contract="BrightsideGroup.Repa.Configuration.IConfigurationWCFService" />
        <endpoint binding="mexHttpBinding" address="mex" name="mex" contract="IMetaDataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://GD01316:9123/Repa" />
            <add baseAddress="http://GD01316:8123/Repa" />
          </baseAddresses>
        </host>
      </service>
      <service behaviorConfiguration="serviceBehavior" name="BrightsideGroup.Repa.Configuration.ConfigurationWCFAdminService">
        <endpoint address="ConfigurationAdminService" binding="netTcpBinding"
          bindingConfiguration="tcpBinding" name="tcpConfigurationAdmin"
          contract="BrightsideGroup.Repa.Configuration.IConfigurationAdminWCFService" />
        <endpoint binding="mexHttpBinding" address="mex" name="mex" contract="IMetaDataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://GD01316:9124/Repa" />
            <add baseAddress="http://GD01316:8124/Repa" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehavior">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

Can someone spot anything wrong with this??

+2  A: 

You have the casing incorrect - the WCF configuration is case-sensitive

 <endpoint address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange" />

Note that the "D" is not capitalized in IMetadataExchange You can double check the syntax on MSDN.

Philip Rieck
Thank you. I knew it had to be something simple!! COuld not see the forest for the trees!! thank you.
jimplode
A: 

I hope the following link may provide you the help:

http://stackoverflow.com/questions/2579288/mextcpbinding-in-wcf-imetadataexchange-errors

and also try adding the following :

<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
Siva Gopal
Marked down as the question had already been answered, and this would not work as it is the wrong protocol, I am using http, not net.tcp.
jimplode
Since i saw an entry for net.tcp in base address, i presumed that you are using that too. Also, by the time i answered the question, i didn't get the alert about the existence of another answer. Thank you.
Siva Gopal