Click here to Skip to main content
15,878,809 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All,

I know what is WCF and Windows service theoretically, But one thing i am not cleared ie If required we can put the logic of windows service in the WCF, let me explain this with the below example:

For every 2 mins i need to check a database table which has any information or not, if it is has then collect all information and use it for processing and delete the collected records information. similarly check this with time span of 2 mins.

Now same logic i will put in the WCF, i will create a ASPX page which will reload for 2 mins using some Timers
(
setTimeout(function(){
window.location.reload(1);
}, 5000);
),
Finally in the page load i will call the WCF. So my task will be over.
I just want to know the scenarios/situation where exactly only windows service can be use not any WCF or web service.

Could you please suggest on this.

Thanks
Posted

As per your requirement I think that NetTcpBinding is best suitable in WCF.

As per your requirement, if you use NetTcpBinding in WCF and setup a service or use a windows service both can serve your purpose.

But windows service comes with some potential problems like service dependency, location of your file execution, user accounts accessibility etc.,.

check this link below.
http://www.montgomerysoftware.com/CreatingaWindowsServiceinC/tabid/164/language/en-US/Default.aspx[^]

Thanks.
 
Share this answer
 
I got the better knowledge in that ie. If we use Web means then it will consume some network bandwidth with Req/Res. So Instead of relies in the network you can run a Windows Service which will be managed by the OS so better handling of you logic.

So any background process which runs continuously required in the minutes/ hours then go with Windows Service

If Any task to be perform an Daily/Monthly/Weekly basis then go for Schedulers

other wise go with WCF(Re usability)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900