Error: Unable to get metadata from when using WCF client to access service on another computer

I am new to WCF. So here's the thing: I have two systems, one of which runs a wcf service and the other runs a client. I can check the IP address of the service and also see the link when I put it in my browser. (This shows that the service is up and running). Anyway, when I try to run wcftestclient from cmd it gives me this error:

Error: Unable to get metadata from If it is a Windows (R) Communication Foundation service that you have access to, ...

I've tried all day and it says the same thing. Can someone please let me know what happened and how to fix it?

Thanks, Thothathri


source to share

3 answers

Is your service provided with a metadata endpoint? Only the relevant parts of the configuration included

  <service behaviorConfiguration="metadataBehavior" name="MyService">
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <behavior name="metadataBehavior">
      <serviceMetadata httpGetEnabled="true" />




The WcfTestClient utility depends on the availability of WSDL for this service. The WSDL is provided by the Metadata Exchange (or "mex") endpoint. You are probably missing this endpoint. Look for something like this in your config, or add it if it's missing:

<service ... >
    <endpoint ...(your usual endpoint for the service)... />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />




Do you have metadata exchange on your service? Your service must provide a mex endpoint for metadata for WcfTestClient to work AFAIK.

MSDN: A Practical Guide. Publishing metadata for a service using a configuration file



All Articles