gpt4 book ai didi

c# - 尝试调用 wcf 服务时出错

转载 作者:可可西里 更新时间:2023-11-01 02:42:30 26 4
gpt4 key购买 nike

我正在尝试连接到服务器上的 WCF 服务。

我已经在服务器的 IIS 中设置了一个站点,并将 Enabled Protocols 设置为 http,net.tcp。此外,我还像这样配置了 Site Bindings:

  • http > 端口:80 > IP地址:*
  • net.tcp > 绑定(bind)信息:808.*

Authentication 下,我启用了 Anonymous AuthenticationWindows Authentication

服务 Net.Tcp Listener AdapterNet.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 进行连接,我还需要做些什么吗?

提前致谢

最佳答案

这似乎是网络问题,因为 10060 表示连接超时。

  1. 检查服务器防火墙并确保已启用 Windows Communication Foundation Net.TCP 监听器适配器 (TCP-In) 规则。

  2. 检查客户端计算机的防火墙并添加确保允许 808 端口上的 tcp 连接的出站规则

  3. 如果您仍然无法连接,网络防火墙设备可能阻止了请求

关于c# - 尝试调用 wcf 服务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33516596/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com