Reputation: 5417
What are the differences between a web service and a Windows service?
My experience has mostly been with Windows services, and I have never created a web service.
Do web services behave similarly to Windows services?
Can they have scheduling, run at certain times, etc.?
When you would use a web service in place of a Windows service, and vice versa?
Upvotes: 20
Views: 51930
Reputation: 1
In addition to what GEOCHET wrote: there is a fundamental difference between them. A Windows service runs on the Windows operating system and mainly serves local purposes on the machine itself or the local network. While a web service is a general service that in principle can run on any operating system installed on a web server. Its purpose is to give World Wide users access to the services that the web server exposes through a dedicated API predefined by the server. In fact the server runs a dedicated process to expose this API.
Upvotes: 0
Reputation: 9
A Web Service is a dll hosted by a web server and run as a web application and can be spun up upon request.
A windows service is an exe hosted by the operating system and runs continuously waiting on a request.
Upvotes: 0
Reputation: 21323
You are asking us to compare apples and oranges. I am posting definitions as well as links to further reading for you so you can see why these two things are exclusive and cannot be compared like you are trying to do.
Web services are frequently just Internet application programming interfaces (API) that can be accessed over a network, such as the Internet, and executed on a remote system hosting the requested services
A Windows service is a long-running executable that performs specific functions and which is designed not to require user intervention.
Upvotes: 12
Reputation: 7306
I don't think there is a very large difference, a web service runs in IIS or Apache, a windows service doesn't. You can call windows service methods by using remoting and you can create windows service with WCF. The methods of a windows service can return xml or json too.
IIS 6 doesn't support all the WCF possibilities so we have build WCF windows services (this is called self hosting).
Both a web service and a windows service are apps that run in the background. You can use WCF to build both kind of services.
Upvotes: 1
Reputation: 10776
Webservices are simply a way of exposing services for consumption. They are about interaction between components.
A windows service is an executable that runs for a long time on a machine to perform some task.
You wouldn't use one in place of the other - they perform two entirely different functions.
For (a simple) example (to highlight the difference), if you wanted a method to pass control messages to your service, you could expose a webservice as the protocol through which third parties would communicate with your service.
Upvotes: 2
Reputation:
web service was mostly used in application integration between systems.
windows service was mostly used in background tasks, scheduled tasks.
A windows service program can call web service methods. web service program cannot call window service methods.
Upvotes: 0
Reputation: 4224
A web service is an HTTP interface to a system. For example: the Twitter API or the Google Maps API are REST web services.
A Windows Service is a background process that runs without user interaction.
The two are not related.
Upvotes: 3
Reputation: 60438
They're about as different as two things can be.
A Windows service is an application that runs without a user being logged into the system, usually to process some data on the machine that needs no user intervention to work with.
A Web service is a website that, when contacted, returns XML (typically) in one of several standard formats for the service consumer to process.
One can't be substituted for the other. They are fundamentally different.
Upvotes: 45
Reputation: 25523
A web service is software system used for machine to machine communication over a network.
Here's the wiki for Web Service.
A windows service, in contract, is a service that runs on an local machine.
Here's the wiki for Windows Service.
They are independent technologies, one would not replace the other.
Upvotes: 1