Search code examples
.netwcfweb-servicesconfigurationwcf-configuration

Why IMetadataExchange is invisible?


I have created WCF Service that is hosted with IIS 6 (Windows XP):

<system.serviceModel>        
    <behaviors>
      <serviceBehaviors>
        <behavior name="myServiceBehaviors">          
          <serviceMetadata httpGetEnabled="true"/>          
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>    
    <services>
      <service name="Namespace.Class" behaviorConfiguration="myServiceBehaviors">                
        <endpoint  contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />        
      </service>      
    </services>        
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>      

I have created virtual directory (MyVirtualFolder) with Visual Studio 2010 and when I point browser to "http://localhost/MyVirtualFolder/MyService.svc" I get error page that tells me that I should turn on interface for metadataExchange with instructions how to do that, how I shall modify my configuration file. I double checked that and my config is equal to one that was proposed by html page.

Why does IMetaDataExchange interface is unavailable?

Thank you in advance!


Solution

  • Finally I found out what was the reason:

    <service name="Namespace.Class"> pointed to wrong class :(