且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Windows Service中执行的应用程序;将数据发送到Web服务,然后将数据发送到SQL数据库

更新时间:2023-01-01 16:38:40

您需要在Web服务器中模拟一个有效的Windows帐户以访问MSSQL. Web服务器仍将使用匿名(用于传入请求),但在内部必须访问资源时,将使用此新的有效Windows帐户进行操作.

You need to impersonate in the Web Server a valid Windows account to access the MSSQL. The Web Server will still use Anonymous (for incoming requests) but internally when it has to access resources, will do with this new valid Windows account.

换句话说:

  • windows服务在系统帐户下运行
  • windows服务调用Web服务
  • 该Web服务不关心调用方的身份,它使用匿名身份验证.
  • 该Web服务在内部模拟了Windows帐户(例如mydomain \ myprogram)以访问资源(例如MSSQL).
  • The windows service runs under system account
  • The windows service calls the web service
  • The web service doesn't care about the identity of callers, it uses anonymous auth.
  • The web service internally impersonates a Windows account (e.g mydomain\myprogram) to access resources (e.g. MSSQL).

为此,您可以看一下这篇文章: http://support.microsoft.com/kb/306158 .

To do this, you can take a look to this article: http://support.microsoft.com/kb/306158.

此致

毛罗