What are the differences between a web service and a Windows service?
Asked Answered
G

9

20

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?

Grouse answered 23/6, 2009 at 16:5 Comment(0)
B
45

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.

Britannia answered 23/6, 2009 at 16:11 Comment(3)
+1, and JSON is a popular second option for a response formatDogie
Are they really that different? If you have a windows service that processes messages received from MSMQ on demand. Is that much different from a webservice that process http requests on demand?Wace
@Britannia Around the begining of this year(in our calendar), i had an interview, to be honest, i was good programmer through people i was in touch with, but i never worked on web based application (just a bit of web form around 2005, and some MVC hello world), ... ,So due my 'CV', the company, called in, and i went to interview, it was good, though i wasnt web user it went well, till they asked about diff of web service and widnwos one, and the hard part.. can web service be used for sending critical data, inside a company... So, can you tell us about their usage, in details, and preferences?Arrhythmia
C
12

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 service:

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

Windows service:

A Windows service is a long-running executable that performs specific functions and which is designed not to require user intervention.

Cuvette answered 23/6, 2009 at 16:9 Comment(1)
So when we create WCF Contract and host it on a Windows Service, we are provider of APIs, then what it is? the windows service... or a Web Service (ex. which implement and run some background web hosting service, without us knowing)Arrhythmia
I
3

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.

Iggie answered 23/6, 2009 at 16:13 Comment(0)
C
2

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.

Cairns answered 23/6, 2009 at 16:10 Comment(0)
I
1

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.

Immitigable answered 23/6, 2009 at 16:11 Comment(0)
B
1

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.

Brogle answered 23/6, 2009 at 17:46 Comment(1)
You don't build a windows service with WCF, but you can host a WCF service in a windows service. :)Touzle
S
0

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.

Scaphoid answered 23/6, 2009 at 17:5 Comment(1)
A web service program can call window service methods.Brogle
S
0

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.

Shrubbery answered 30/5, 2018 at 15:35 Comment(0)
C
0

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.

Caty answered 26/2 at 10:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.