简体   繁体   English

WCF服务和防火墙…有什么问题吗?

[英]WCF services and firewalls… Any issues?

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. 我正在为具有附加数据库连接的应用程序进行概念验证,因此我将创建WCF服务来包装数据库。 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. 服务主机目前尚无定形,但很可能将其托管在应用程序本身中或作为Windows服务托管。

Unfortunately, the client application is a WIN32 Delphi application which needs a simple way to access the service. 不幸的是,客户端应用程序是WIN32 Delphi应用程序,它需要一种简单的方法来访问服务。 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. 最好是,单用户版本应该使用与多用户版本相同的技术来访问服务器,这意味着它的行为类似于SOAP客户端,并且导入了WSDL并将其转换为Delphi代码。

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? 那么,有人知道在此单用户环境中可能发生的任何防火墙问题吗?

You haven't mentioned which WCF channel you're using- I'll assume basicHttpBinding. 您没有提到要使用哪个WCF频道-我将假设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. 通常,如果使用自托管将本地服务绑定到127.0.0.1,并且机上客户端以这种方式访问​​它,则应该没问题。 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. 但是,如果将服务绑定到计算机的IP,则可能会遇到防火墙的麻烦。

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 . 如果您在客户端的两端都有WCF 3.5(对不起,我对Delphi一无所知),请尝试使用netNamedPipeBinding

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 . 您没有提到要使用哪个版本的Delphi,但是我曾经很难使Delphi 2005导入具有basicHttpBinding的WCF服务。 As the WSDL is split among many pages, the SOAP import wizard in Delphi wasn't capable of understanding it. 由于WSDL分为许多页面,因此Delphi中的SOAP导入向导无法理解它。 I finally ended up writing an ASMX wrapper around the WCF service for Delphi clients. 最后,我最终为Delphi客户端编写了围绕WCF服务的ASMX包装器。

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

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