简体   繁体   English

尝试调用 wcf 服务时出错

[英]Error while trying to call a wcf service

I'm trying to connect to a WCF service on a server.我正在尝试连接到服务器上的 WCF 服务。

I've set up a Site in the IIS on the server and set the Enabled Protocols to http,net.tcp .我已经在服务器上的 IIS 中设置了一个站点,并将Enabled Protocols设置为http,net.tcp Additionally, I configured the Site Bindings like this:此外,我像这样配置了Site Bindings

  • http > Port: 80 > IP Address: * http > 端口:80 > IP 地址:*
  • net.tcp > Binding Information: 808.* net.tcp > 绑定信息:808.*

Under Authentication , I've enabled Anonymous Authentication and Windows Authentication .Authentication ,我启用了Anonymous AuthenticationWindows Authentication

The services Net.Tcp Listener Adapter and Net.Tcp Port Sharing Service are running too.服务Net.Tcp Listener AdapterNet.Tcp Port Sharing Service也在运行。

When I call the webservice with a browser (via http ), everything works and I can list the wsdl etc.当我使用浏览器(通过http )调用网络服务时,一切正常,我可以列出wsdl等。

But when trying to connect via tcp , I get the following error:但是当尝试通过tcp连接时,我收到以下错误:

Error: Cannot obtain Metadata from net.tcp://myserver/MyService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.错误:无法从 net.tcp://myserver/MyService.svc 获取元数据 如果这是您有权访问的 Windows (R) Communication Foundation 服务,请检查您是否已在指定地址启用元数据发布。 For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: net.tcp://myserver/MyService.svc Metadata contains a reference that cannot be resolved: 'net.tcp://myserver/MyService.svc'.有关启用元数据发布的帮助,请参阅 MSDN 文档,网址http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange 错误 URI:net.tcp://myserver/MyService.svc 元数据包含无法解析的引用:“net.tcp://myserver/MyService.svc”。 Could not connect to net.tcp://myserver/MyService.svc.无法连接到 net.tcp://myserver/MyService.svc。 The connection attempt lasted for a time span of 00:00:21.0010999.连接尝试持续了 00:00:21.0010999 的时间跨度。 TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.x.yyy.zz:808. TCP 错误代码 10060:连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应 10.x.yyy.zz:808 建立的连接失败。 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.x.yyy.zz:808连接尝试失败,因为连接方在一段时间后没有正确响应,或者因为连接的主机没有响应而建立连接失败 10.x.yyy.zz:808

  • Are there any other things I have to make sure to be able to connect via tcp ?是否还有其他任何事情我必须确保能够通过tcp连接?

Thanks in advance提前致谢

This seems to be a network issue since 10060 means connect timeout.这似乎是一个网络问题,因为 10060 意味着连接超时。

  1. Check the server firewall and make sure that Windows Communication Foundation Net.TCP Listener Adapter (TCP-In) rule is enabled.检查服务器防火墙并确保启用了 Windows Communication Foundation Net.TCP 侦听器适配器 (TCP-In) 规则。

  2. Check the client computer's firewall and add make sure an outbound rule allowing tcp connections on port 808检查客户端计算机的防火墙并添加确保允许端口 808 上的 tcp 连接的出站规则

  3. If you still can't connect, a network firewall device might be blocking the request如果仍然无法连接,可能是网络防火墙设备阻止了请求

我认为您可能需要打开元数据交换: 下面解释了一种方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM