What is a "web service" in plain English?

MrDatabase picture MrDatabase · Oct 22, 2008 · Viewed 135.8k times · Source

I've been reading about "web services" here on SO, on Wikipedia, Google, etc., and I don't quite understand what they are. What is the plain English definition/description?

If I make a simple website using PHP that just, say, prints a random integer to the page... is this a "web service"? If not, why not?

Answer

Vincent Ramdhanie picture Vincent Ramdhanie · Oct 22, 2008

A simple definition: A web service is a function that can be accessed by other programs over the web (HTTP).

For example, when you create a website in PHP that outputs HTML, its target is the browser and by extension the human reading the page in the browser. A web service is not targeted at humans but rather at other programs.

So your PHP site that generates a random integer could be a web service if it outputs the integer in a format that may be consumed by another program. It might be in an XML format or another format, as long as other programs can understand the output.

The full definition is obviously more complex but you asked for plain English.