使用启用 COM 的 .NET 客户端 dll 从 IE 访问 Windows 服务中的命名管道端点
我有一个托管在 Windows 服务中的 WCF 服务。此 WCF 服务仅在本地计算机上使用,因此我为端点选择了命名管道。但是,当我尝试从 IE 中由 JavaScript 实例化的客户端连接到 WCF 服务时,找不到端点。
但是,如果我停止 Windows 服务并运行可执行文件(它可以检测环境是否是用户交互的),那么客户端也可以从 IE 连接。
顺便说一句,我尝试在绑定配置中将安全性设置为“无”。
到目前为止:
IE 运行 JavaScript 的完整性级别低于创建命名管道的级别,这是正常的,因为服务具有系统完整性级别。现在的问题是降低创建的命名管道的完整性级别。
答:
我会留下这个问题来提醒自己我是多么愚蠢。答案隐藏在问题中。当可执行文件检测到该环境是用户交互的时,它会运行可执行文件中的所有注册服务。当您手动启动服务时,您就启动了一项服务。
I have a WCF service hosted in a windows service. This WCF service is only going to be used on the local machine so I have chosen named pipes for endpoint. However when I try to connect to WCF service from the client instantiated by JavaScript in IE, endpoint is not found.
However if I stop the windows service and run the executable (it can detect whether environment is user interactive or not) then client can connect from IE as well.
BTW, I have tried setting security to None in binding configurations.
So far:
IE is running JavaScript in a lower integrity level than named pipe is created, which is normal since service has system integrity level. Question now is lowering the integrity level of created named pipe.
Answer:
I will leave this question to remind myself how stupid I am. Answer is hidden inside the question. As the executable detects that environment is user interactive, it runs all registered services in the executable. When you start a service manually, well, you start a service.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我遇到类似的问题时,我通过在 处理 WCF 命名管道场景中的操作系统权限“问题”
When I a similar problem I fixed it by doing as Christian details in Dealing with OS privilege 'issues' in WCF Named Pipes scenarios