简体   繁体   English

WCF服务在本地工作,但在iis7上无法正常工作

[英]Wcf service workes locally, but not properly on iis7

I have a test gui(winform) which I use to test my wcf service. 我有一个测试gui(winform),可用来测试我的wcf服务。 The service call´s another project in my solution which uses some windows api methods(user32.dll) to find word dialog boxes. 该服务调用是我解决方案中的另一个项目,该项目使用一些Windows api方法(user32.dll)查找单词对话框。 It works fine when I test it locally, but when I setup my wcf service in the iis and test it with soapUI, it fails to retrieve and do the desired action on the word dialog boxes. 当我在本地测试它时,它可以正常工作,但是当我在iis中设置wcf服务并使用soapUI测试它时,它无法检索并在单词对话框上执行所需的操作。

I suspect that because I am using a winform to test the service, so when I run the test form the solution creates instances/handlers so the windows/dialogboxes are at my disposal in the solution. 我怀疑是因为我正在使用Winform来测试服务,所以当我运行测试表时,解决方案会创建实例/处理程序,以便Windows /对话框可以在解决方案中使用。 Testing the service alone without creating the test winform does not make the service get the dialogboxes... 单独测试服务而不创建测试Winform不会使服务获得对话框...

Could this be a permission issue in the iss or somewhere else? 这可能是iss或其他地方的权限问题吗? I have tried to grant the worker process admin rights, but maby I am not granting the rights in the wrong place. 我试图授予工作进程管理员权限,但是老兄,我并没有在错误的地方授予这些权限。 I need find out how the service alone can get a hold of the windows/dialogboxes with user32.dll methods? 我需要找出单独的服务如何可以通过user32.dll方法来获取Windows /对话框?

windows 7 pro, iis7, vs2010 Windows 7专业版,IIS7和vs2010

Any help is greatly appreciated. 任何帮助是极大的赞赏。

Your approach is completely wrong. 您的方法是完全错误的。 It works under Visual Studio because it's runing under your user account, but once deployed in IIS, it runs in the context of the App Pool account, which has limited rights and can't interact with Desktop. 它在Visual Studio下工作,因为它是在您的用户帐户下运行的,但是一旦在IIS中部署,它便会在App Pool帐户的上下文中运行,该帐户具有有限的权限并且无法与Desktop进行交互。 Even if you run the service under an Admin account, which is a big security flaw, it will only work with local windows, never with windows on remote machines. 即使您使用管理员帐户(这是一个很大的安全漏洞)运行该服务,该服务也仅适用于本地Windows,而不适用于远程计算机上的Windows。 If you explain better your requirements maybe we could suggest a better approach for this. 如果您能更好地解释您的要求,也许我们可以建议一种更好的方法。

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

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