Web Service vs Windows Service

I need to decide whether to use a Web or Windows service for an upcoming project, but don't understand the advantages/disadvantages of each.  The service needs to do two basic things:

- accept incoming requests from an ASP.NET web application to kick off a long running process, and alert the user when it is complete.
- automatically kick off similar long running processes based on a specific schedule

One of the questions I have is can a web service start a thread (in this case the schedule thread) when it is started?  Does web services even allow multi-threading?  Since a web service runs under IIS, can it take advantage of web farms?

Any feedback would be greatly appreciated!
StewartMeyersAsked:
Who is Participating?
 
surajgupthaConnect With a Mentor Commented:
>>can a web service start a thread (in this case the schedule thread) when it is started?  
What do u mean by a scheduled thread. Are you looking for the web service to generate alerts or check something periodically??

>> Does web services even allow multi-threading?  
Yes it automatically handles mutiple requests. And you could also use multi threading within the web services code if you wanted.

>>Since a web service runs under IIS, can it take advantage of web farms?
Web Frams in terms of the database or web frams as in multiple copies of the web services in different servers and to be able to view all the web services as just one service ??
0
 
surajgupthaCommented:
Since you want this middle tier for only ur ASP .net web application i would suggest the use of windows services. THere is no real need for web services unless you are looking for interoperability in my opinion.
0
 
StewartMeyersAuthor Commented:
>>What do u mean by a scheduled thread?
A portion of the service is a scheduler which will kick off processes automatically based on a time in the future.

>>Web Farms in terms of the database or web farms as in multiple copies of the web services in different servers and to be able to view all the web services as just one service ??
Multiple copies of the web service.

>>Since you want this middle tier for only ur ASP .net web application i would suggest the use of windows services. THere is no real need for web services unless you are looking for interoperability in my opinion.
Can you please elaborate a bit?  What would be the disadvantage of a web service?  Thanks.
0
 
surajgupthaCommented:
web services are not designed for running scheduled threads. The best best in my opinion if you want to do that would be windows services.

Web farms would be possible using clustering. But thats not web service implementable but can be implemented on Win 2003

web services are slower since they use XML serialization
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.