从 Web 服务调用 Windows 服务 [英] Calling Windows Service from a Web Service

查看:57
本文介绍了从 Web 服务调用 Windows 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 .Net 2.0 框架并想从 Web 服务调用 Windows 服务中的函数.这可能吗?如果是,我将对该函数有多少控制权,即传递参数、返回结果等.任何想法将不胜感激:)

I am using .Net 2.0 framework and would like to call a function in Windows service from a web service. Is this possible? And If yes, how much control I will have over the function i.e passing parameters, getting the result back etc. Any ideas would be greatly appreciated :)

推荐答案

如何在 Windows 服务内部托管 WCF 服务.您可以使用 net.tcp 或命名管道在您的"Web 服务和 Windows 服务中的服务之间进行通信.您可以使用 NetDataContractSerializer 进行类型保真序列化.

How about hosting a WCF service inside of the Windows Service. You can use net.tcp or named pipes to communicate between "your" web service and the one in the Windows Service. You can use the NetDataContractSerializer for serialization with type fidelity.

这篇关于从 Web 服务调用 Windows 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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