通过web服务公开SQL服务器数据库的最佳方式是什么

时间:2022-09-15 21:08:37

We have a SQL Server on an internal network. Now however, we want to create a public web site that allows users to access some of the data on the SQL Server. To avoid giving the public web server direct access to the SQL Server, we have decided to write a web service to expose the necessary database objects. The service (and consuming web site, for what it is worth) is to be written in .NET. It seems to me we have two options here.

我们在内部网络上有一个SQL服务器。但是,现在我们希望创建一个公共web站点,允许用户访问SQL服务器上的一些数据。为了避免公共web服务器直接访问SQL服务器,我们决定编写一个web服务来公开必要的数据库对象。服务(和消费网站,就其价值而言)是在。net中编写的。在我看来,我们有两个选择。

  • We already have IIS on the SQL Server for reporting services, so I could just build a web service that is hosted by IIS.
  • 我们已经在SQL Server上提供了用于报告服务的IIS,所以我可以构建一个由IIS托管的web服务。
  • We already have a Windows service that performs other maintenance functions for the database in question, so I could use WCF and embed the web service functionality in the existing service.
  • 我们已经有了一个Windows服务,它为相关的数据库执行其他维护功能,因此我可以使用WCF并将web服务功能嵌入到现有的服务中。

I am leaning toward the IIS approach, as that one seems simpler. Am I wrong?

我倾向于使用IIS方法,因为这个方法似乎更简单。我错了吗?

1 个解决方案

#1


5  

Don't re-purpose your windows service to double up as a windows service. Keep the internet away from that thing.

不要将你的windows服务转换为windows服务。让互联网远离那些东西。

Build an IIS hosted webservice, and secure it separately.

构建IIS托管的web服务,并分别对其进行安全保护。

#1


5  

Don't re-purpose your windows service to double up as a windows service. Keep the internet away from that thing.

不要将你的windows服务转换为windows服务。让互联网远离那些东西。

Build an IIS hosted webservice, and secure it separately.

构建IIS托管的web服务,并分别对其进行安全保护。