Yes, the terminology can be confusing! Let’s start with some definitions.
What is a Windows Service?
A Windows Service:
- Is a Windows application that integrates with the Service Control Manager.
- Is controlled through the Services Control Panel application.
- Implements system-level tasks that must operate outside the boundaries of a user’s login session.
- Is usually long-running, starting when the computer boots and running uninterrupted, 24/7.
- Works invisibly in the background. A service can’t easily show itself on a user’s desktop.
- Can do anything that a “regular” application can. Services can read and write files, print documents, check the time, access the network, and much more.
- Runs on Windows only. Windows Services are not available on Linux, macOS, Andriod, iOS or any other operating system.
- Is typically written in C++ or C# (to best work with the low-level Windows Services API).
- May or may not communicate with other programs. Inter-application communication is not a key feature and most services do not expose an interface of any kind.
A modern PC comes with one to two hundred Windows Services pre-installed, each managing an important aspect of your computing experience. For example:
Print Spooler: Manages all printing on your computer.
Power: Implements your computer’s power schemes, policies and notifications.
Task Scheduler: Responsible for automatically launching executables, batch files and scripts at specified times, without human intervention.
What is a Web Service?
A Web Service:
- Interacts with other applications or services using a well-defined system of data exchange (such as REST or SOAP).
- Typically communicates over HTTP with an appropriate messaging format on top (such as XML or JSON).
- Is usually hosted in a web server/container, like Apache Tomcat, Microsoft IIS or Play Framework. A good framework provides easy-to-use messaging “plumbing” and makes it significantly simpler to develop a robust web service.
- Has a web-based interface (if any at all).
- Is not restricted to Windows alone. In fact, most web services are deployed on UNIX servers.
Examples of web services include:
|Amazon Simple Storage Service (S3): Integrate cloud storage into any application.
|Google Maps: Lookup addresses, plot directions, access street views and more.
|WorldTimeAPI: Get the current time in any time zone.
The upshot: Windows Services and Web Services are very different!
The only things they have in common are that they are both server technologies and have the word “Service” in their names. 🙂 As a developer, you shouldn’t have much trouble choosing which technology is appropriate for your project.
However, the W* Services are not completely complementary. Though rare, there are a few applications that are both a Windows Service and web service. A good example is our own AlwaysUp Web Service, which must run 24×7 on Windows while providing an XML web service to control the computer remotely.
I hope these similar-sounding technologies make a bit more sense now. Please be sure to get in touch if you have any other questions.