错误:使用WCF客户端访问另一台计算机上的服务时无法从http://172.16.70.125:8080/获取元数据

发布于 2024-11-10 07:23:07 字数 400 浏览 1 评论 0原文

我是 WCF 的新手。事情是这样的:我有两个系统,一个运行 wcf 服务,另一个运行客户端。 我能够 ping 通该服务的 IP,并且当我将其放入浏览器时也能够看到该链接。 (它显示服务已启动并正在运行)。 但是,当我尝试从 cmd 运行 wcftestclient 时,它给出了此错误:

错误:无法从 http:// 获取元数据172.16.70.125:8080/Service 如果这是您有权访问的 Windows (R) Communication Foundation 服务,...

我一整天都在尝试此操作,它说的是同样的事情。 有人可以让我知道出了什么问题以及如何解决这个问题吗?

谢谢, 托塔提利

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

拒绝两难 2024-11-17 07:23:07

WcfTestClient 实用程序取决于可用于该服务的 WSDL。 WSDL 由元数据交换(或“mex”)端点提供。您可能错过了那个端点。在您的配置中查找类似的内容,如果缺少则添加它:

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

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>
浊酒尽余欢 2024-11-17 07:23:07

您的服务是否公开了元数据端点?仅包含配置的相关部分

<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>

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>
人生百味 2024-11-17 07:23:07

您的服务是否启用了元数据交换?您的服务应该为元数据提供 mex 端点,以便 WcfTestClient 正常工作。

MSDN:如何:使用配置文件发布服务的元数据

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文