WCF 服务和防火墙...有任何问题吗?
简单的问题。我正在为具有附加数据库连接的应用程序进行概念验证,因此我将创建一个 WCF 服务来环绕数据库。多用户环境将将此服务安装在中央服务器上,并在本地系统上安装客户端应用程序。这些用户将自动处理防火墙问题,因此这是可以接受的。
但单用户环境将在单个系统上运行服务和客户端应用程序。服务主机目前还没有确定的形式,但很可能它将托管在应用程序本身中或作为 Windows 服务托管。
不幸的是,客户端应用程序是一个 WIN32 Delphi 应用程序,它需要一种简单的方法来访问服务。优选地,单用户版本应使用与多用户版本相同的技术来访问服务器,这意味着它的行为类似于 SOAP 客户端,导入 WSDL 并将其转换为 Delphi 代码。
仍然不是问题,但我必须考虑在此设置中可能遇到的问题,其中最重要的问题是:可能的防火墙关闭了连接端口。
那么,有人知道在这种单用户环境中可能出现的防火墙问题吗?
Simple issue. I'm working on a proof-of-concept for an application with additional database connection, so I will create a WCF service to wrap around the database. Multi-user environments will get this service installed on a centralized server with a client application on their local system. These users will automatically have to deal with firewall issues, so this is acceptable.
But the single-user environments will have the service and client application running on a single system. The service host doesn't have a definite shape right now, but it's likely that it will be hosted within the application itself or as a Windows service.
Unfortunately, the client application is a WIN32 Delphi application which needs a simple way to access the service. Preferably, the single-user version should use the same technique to access the server as the multi-user version, which means that it behaves like a SOAP client, with a WSDL imported and converted to Delphi code.
Still not a problem, but I have to consider possible problems that we can encounter in this setup, with the most important issue: possible firewall that closed the connection port.
So, does anyone know about any firewall problems that can occur in this single-user environment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还没有提到您正在使用哪个 WCF 通道 - 我假设是 basicHttpBinding。一般来说,如果您的本地服务使用自托管绑定到 127.0.0.1,并且本地客户端以这种方式访问它,那么应该没问题。据我所知,没有任何防火墙会破坏您的环回适配器。如果您将服务绑定到机器的 IP,您可能会受到防火墙的影响。
如果两端的客户端都可用 WCF 3.5(抱歉,我对 Delphi 一无所知),请尝试 netNamedPipeBinding。
You haven't mentioned which WCF channel you're using- I'll assume basicHttpBinding. Generally, if your local service is bound to 127.0.0.1 using self-hosting, and the on-box client accesses it that way, you should be fine. No firewalls I'm aware of will screw with your loopback adapter. If you bind the service to the machine's IP though, you may subject yourself to firewall fun.
If you have WCF 3.5 available on the client on both ends (sorry, I don't know anything about Delphi), have a go with netNamedPipeBinding.
您没有提到您使用的是哪个版本的 Delphi,但我曾经很难让 Delphi 2005 使用
basicHttpBinding
导入 WCF 服务。由于WSDL
被分割在许多页面中,Delphi 中的 SOAP 导入向导无法理解它。我最终为 Delphi 客户端围绕 WCF 服务编写了一个 ASMX 包装器。You didn't mention which version of Delphi you use but I once had hard time making Delphi 2005 import a WCF service with
basicHttpBinding
. As theWSDL
is split among many pages, the SOAP import wizard in Delphi wasn't capable of understanding it. I finally ended up writing an ASMX wrapper around the WCF service for Delphi clients.