开发者

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

开发者 https://www.devze.com 2023-03-09 06:52 出处:网络
I\'m a newbie to WCF. So here\'s the thing : I have two systems, one running the wcf service and the other run开发者_Go百科ning the client.

I'm a newbie to WCF. So here's the thing : I have two systems, one running the wcf service and the other run开发者_Go百科ning 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


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>


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>


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

MSDN: How to: Publish Metadata for a Service Using a Configuration File

0

精彩评论

暂无评论...
验证码 换一张
取 消