1

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!

Andrew Florko
  • 7,672
  • 10
  • 60
  • 107

3 Answers3

0

Try <serviceMetadata /> instead of <serviceMetadata httpGetEnabled="true"/>.
If you host a web service in IIS, you have an *.svc file. You don't need an endpoint to get metadata, delete the endpoints, and all will work fine..

croisharp
  • 1,926
  • 5
  • 25
  • 40
0

Remove address="mex" from your IMetadataExchange endpoint.

Also there's no actual endpoint for your service itself.

If possible, try using SvcConfigEditor, the WCF configuration editor (part of Windows SDK) to get a working service and client configuration.

Filburt
  • 17,626
  • 12
  • 64
  • 115
0

Finally I found out what was the reason:

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

Andrew Florko
  • 7,672
  • 10
  • 60
  • 107