尝试调用 wcf 服务时出错
Error while trying to call a wcf service
我正在尝试连接到服务器上的 WCF 服务。
我在服务器的 IIS 中设置了一个站点,并将 Enabled Protocols
设置为 http,net.tcp
。
此外,我这样配置 Site Bindings
:
- http > 端口:80 > IP 地址:*
- net.tcp > 绑定信息:808.*
在 Authentication
下,我启用了 Anonymous Authentication
和 Windows Authentication
。
服务 Net.Tcp Listener Adapter
和 Net.Tcp Port Sharing Service
也是 运行。
当我使用浏览器调用网络服务时(通过 http
),一切正常,我可以列出 wsdl
等
但是当尝试通过 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. 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'. Could not connect to net.tcp://myserver/MyService.svc. The connection attempt lasted for a time span of 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. 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
连接,我还需要做其他事情吗?
提前致谢
我认为您可能需要打开元数据交换:
The following explains one way to do it.
这似乎是网络问题,因为 10060 表示连接超时。
检查服务器防火墙并确保 Windows Communication Foundation Net.TCP Listener Adapter (TCP-In) 规则已启用。
检查客户端计算机的防火墙并添加确保允许端口 808 上的 tcp 连接的出站规则
如果您仍然无法连接,网络防火墙设备可能阻止了请求
我正在尝试连接到服务器上的 WCF 服务。
我在服务器的 IIS 中设置了一个站点,并将 Enabled Protocols
设置为 http,net.tcp
。
此外,我这样配置 Site Bindings
:
- http > 端口:80 > IP 地址:*
- net.tcp > 绑定信息:808.*
在 Authentication
下,我启用了 Anonymous Authentication
和 Windows Authentication
。
服务 Net.Tcp Listener Adapter
和 Net.Tcp Port Sharing Service
也是 运行。
当我使用浏览器调用网络服务时(通过 http
),一切正常,我可以列出 wsdl
等
但是当尝试通过 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. 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'. Could not connect to net.tcp://myserver/MyService.svc. The connection attempt lasted for a time span of 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. 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
连接,我还需要做其他事情吗?
提前致谢
我认为您可能需要打开元数据交换: The following explains one way to do it.
这似乎是网络问题,因为 10060 表示连接超时。
检查服务器防火墙并确保 Windows Communication Foundation Net.TCP Listener Adapter (TCP-In) 规则已启用。
检查客户端计算机的防火墙并添加确保允许端口 808 上的 tcp 连接的出站规则
如果您仍然无法连接,网络防火墙设备可能阻止了请求