Wcf服务在本地工作,但在iis7上不正确 [英] Wcf service workes locally, but not properly on iis7

查看:114
本文介绍了Wcf服务在本地工作,但在iis7上不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试gui(winform),用于测试我的wcf服务。服务调用是我的解决方案中的另一个项目,它使用一些windows api方法(user32.dll)来查找单词对话框。当我在本地测试时它工作正常,但是当我在iis中设置我的wcf服务并使用soapUI进行测试时,它无法检索并在单词对话框上执行所需的操作。

I have a test gui(winform) which I use to test my wcf service. The service call´s another project in my solution which uses some windows api methods(user32.dll) to find word dialog boxes. 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.

我怀疑因为我使用winform来测试服务,所以当我运行测试表时,解决方案会创建实例/处理程序,因此Windows /对话框可以在解决方案中使用。单独测试服务而不创建测试winform不会使服务获得对话框...

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. Testing the service alone without creating the test winform does not make the service get the dialogboxes...

这可能是在iss或其他地方的权限问题吗?我试图授予工作进程管理员权限,但maby我不会在错误的地方授予权限。我需要找出服务如何单独使用user32.dll方法保存windows / dialogbox?

Could this be a permission issue in the iss or somewhere else? 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?

windows 7 pro,iis7,vs2010

windows 7 pro, iis7, vs2010

非常感谢任何帮助。

推荐答案

您的方法完全错误。它在Visual Studio下运行,因为它在您的用户帐户下运行,但一旦部署在IIS中,它就在App Pool帐户的上下文中运行,该帐户具有有限的权限且无法与Desktop交互。
即使您在Admin帐户下运行该服务,这是一个很大的安全漏洞,它只能用于本地窗口,而不能用于远程计算机上的Windows。
如果您更好地解释您的要求,我们可能会建议更好的方法。

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. 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. If you explain better your requirements maybe we could suggest a better approach for this.

这篇关于Wcf服务在本地工作,但在iis7上不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆