Error: Cannot obtain Metadata from http://172.16.70.125:8080/ when using WCF client to access service on another computer

10,643

Solution 1

Has your service exposed a metadata endpoint? Only relevent portions of config included

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

Solution 2

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

<service ... >
    <endpoint ...(your usual endpoint for the service)... />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
Share:
10,643
wittythotha
Author by

wittythotha

I'm a student at NC State, and love to learn new and challenging technologies!

Updated on June 27, 2022

Comments

  • wittythotha
    wittythotha almost 2 years

    I'm a newbie to WCF. So here's the thing : I have two systems, one running the wcf service and the other running the client. I'm able to ping the IP of the service, and also able to see the link when I put it into my browser. (It shows me the service is up and running). Howver, when I try to run wcftestclient from cmd, it gives me this error :

    Error: Cannot obtain Metadata from http://172.16.70.125:8080/Service If this is a Windows (R) Communication Foundation service to which you have access, ...

    I've been trying this all day, and its says the same thing. Could someone please let me know what's wrong and how to fix this?

    Thanks, Thothathri