暴露WCF服务无法通过Windows防火墙检索对象

发布于 2024-11-07 05:52:53 字数 412 浏览 2 评论 0原文

我构建了一个 WCF 服务,该服务向 Web 应用程序公开自身,它接受一个对象并在客户端计算机上打印数据。在我的开发机器上运行良好,并且该服务可以在我安装它的任何机器上启动并运行。我可以在客户端计算机的网络浏览器中输入 IP 地址并查看它正在运行。问题是当我将对象发送到客户端计算机时,它返回一个错误,这听起来可能是由于客户端 Windows 防火墙造成的。我该从哪里开始处理这个问题呢?

http://192.168.1.168:2202/PrintLabel 上没有侦听端点可以接受该消息。这通常是由不正确的地址或 SOAP 操作引起的。有关更多详细信息,请参阅 InnerException(如果存在)。

和内部异常:无法连接到远程服务器

I built a WCF service that exposes itself for a web application, it accepts an object and prints the data on the clients machine. Works fine on my development machine, and the service is up and running on any machine i install it on. I can enter ip address in clients machine web browser and see it is running. Problem is when i send the object to the clients machine it returns an error, that sounds like it could be because of the clients windows firewall. Where would i start at to deal with this problem ?

There was no endpoint listening at http://192.168.1.168:2202/PrintLabel that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

And the InnerException: Unable to connect to the remote server

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

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

发布评论

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

评论(1

俏︾媚 2024-11-14 05:52:53

通过与社区中的人们进行进一步的研究和讨论,我开始了解到,正如 这篇文章。
“WCF 的自托管 HTTP 寻址未集成到 Windows 防火墙中。必须在防火墙配置中添加例外,以允许使用特定 URL 的入站连接。

但是 这个问题引导我进入一个有关如何控制 Windows 的页面防火墙通过代码使我的 WCF 自托管服务能够接受对象。
这是下面的链接。

http://www.shafqatahmed.com/2008/01/controlling-win。 html

该链接朝着我需要的方向,但根据用户评论,它似乎有一些错误。一位同事发现 此链接,我相信这种技术将是这种情况的最佳解决方案。

With further research and discussion with people in the community i came to understand that as was mentioned at the bottom of this article.
"Self-hosted HTTP addressing for WCF is not integrated into the Windows firewall. An exception must be added to the firewall configuration to allow inbound connections using a particular URL.

But this SO question led me to a page with how to control Windows Firewall through code to enable my WCF self hosted service to accept an object.
This the link below.

http://www.shafqatahmed.com/2008/01/controlling-win.html

That link was towards the direction i needed, but based on user comments it seemed to have some bugs. A colleague found this link and i believe this technique will be the best solution for this scenario.

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