我可以用wcf服务替换窗口服务 [英] Can i replace window service with wcf service

查看:89
本文介绍了我可以用wcf服务替换窗口服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的主要应用程序是基于Web的应用程序。

我想制作一个可以处理服务器端数据的服务(文件等文件......)。我也在使用第三方工具哪个支持windows应用程序。那么我应该创建WCF服务还是Window服务?我有点困惑。我们是否应该将WCF服务视为Window服务? .....

请给我最好的解决方案....



我尝试过的事情:



我们已经构建了web应用程序。所有数据都在服务器端。还有第三方工具支持windows应用程序。使用这个第三方工具我们已经创建了后台服务。所以应该我直接使用Windows服务创建Windows应用程序或使用Web应用程序的WCF服务。

解决方案

你的意思是守护进程中的服务 [ ^ ]?



我原本认为Windows服务更合适 - WCF是一个'通信框架'(大声思考) )可以在/作为服务实现



就个人而言,我启动Win32'服务'作为控制台程序并使用'Topshelf'来提供服务

这取决于您的要求:您的新服务是否需要与您的主Web应用程序通信,或者它们是否相互隔离?



如果是隔离然后Windows服务更好。假设您希望间隔运行服务。例如,需要以5分钟的间隔向用户发送电子邮件,然后Windows服务更好。



如果主要网络应用程序想要与服务沟通然后WCF更好。我们再次选择实现WCF或WebAPI服务。不要混淆:如果你想实现HTTP RESTful服务就使用WebAPI,如果你有TCP / NamedPipe就使用WCF等。通过以下链接:



WCF和Web之间的差异API和WCF REST和Web服务 [ ^ ]


Our main application is in Web based application.
I want to make a service which will work on server side data (files like documents....) .Also I am using third party tool which support windows application. So shall I create WCF service or Window service ?I am little bit confused.Means shall we treat WCF service as Window service? .....
Please give me best solution....

What I have tried:

We already built web application.All data is on server side .Also third party tool support windows application.Using this third party tool we have create background service .So should I create windows application with windows service or WCF service with web application directly.

解决方案

Do you mean service as in 'Daemon' [^] ?

I would have thought a Windows Service was more appropriate - WCF is a 'framework for communication' that (thinking out loud) could be implemented on/as a service

Personally, I start Win32 'services' as console programs and use 'Topshelf' to make services out of them


It depends on your requirement: Is your new service needs to communicate with your main web application or they are isolated each other?

If it is isolated then Windows Service is better. Let's say you want run the service on interval basis. For instance, there is a requirement to send e-mails to users on 5 min interval basis then Windows Service is better.

If main web application wants to communicate with service then WCF is better. Again we two option to implement service either WCF or WebAPI. Do not confuse: use WebAPI if you want implement HTTP RESTful services and use WCF if you have TCP/NamedPipe etc. Go through below link:

Difference between WCF and Web API and WCF REST and Web Service[^]


这篇关于我可以用wcf服务替换窗口服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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