A web service is a piece of computer code that is running somewhere in the world, and that you can talk to. Because you are communicating with a computer and not a human being, you have to document exactly on how to communicate. This is done by a protocol. There are multiple types of protocols. You can think of a website as a web service. You ask for information using the URL and you receive an answer following the HTML standard.

The following architecture is the foundation of web services:

A service provider is a company or person that builds a web service. They intend to create a service that is widely being adopted. Therefore, they publish their service at a service registry. A service registry is nothing else than a big library for looking up web services. If you want to call an existing web service, you become the service requestor. You look for a web service that matches your needs in the service registry. Once you find a matching service, you want to call its functions, using your own piece of software. To do that, you bind yourself to this service provider, by following the specific communication protocol.

An example of such a service registry is API Ninjas (https://api-ninjas.com/api).
Please go to this link and take a look around.

Building and using web services gives you certain benefits. There is a strict separation of responsibility. A web service is built for one purpose only. This is the foundation of component Service Oriented Architecture (SOA). Multiple smaller components are easier to manage than one big component. Furthermore, because the communication happens over a protocol, it does not matter what programming language the other party is running. The only thing you know of a web service is how to communicate with it, using the protocol. We will go into details on two of these protocols in the next two chapters.

Here are a couple examples of web services:

  • You have the postal code, and want to retrieve the street name and city name. An external system has the responsibility to keep this data up to date.
  • As an insurance company, you built your own web service for computing the monthly payment based on the customers information. Comparison websites such as Independer use this web service to compare different insurance companies.
  • The Google Maps API lets you get directions between two locations.


  • No labels