Web Services Overview
The term "web service" is often used to describe a service that a client (a computer) can call remotely over the internet, via web protocols like HTTP. Like calling a method, procedure or function which is running on a different machine than the client. As such web services are very similar to "remote procedure call" (or just "remoting") protocols, like Java's RMI, Windows DCOM, Corba's IIOP etc. The basic web service principle is illustrated here:
|A computerized client calling a web service over the internet.|
Web services can also be used internally in an organizations network, as a way to allow many different applications to interact with each other. The standardized web service protocols then makes it easier to integrate the various applications. This principle is illustrated here:
|Independent applications on an intranet communicating with each other via web services.|
Web Services vs. Web Sites / Web Applications
The main difference between a web service and a web site is, that a web site is typically intended for human consumption (human-to-computer interaction), whereas web services are typically intended for computer-to-computer interaction.
Of course this distinction is somewhat blurred. A web application can contain both a graphical user interface for human users, as well as a set of web services for computer "users" (clients). For instance, a payment service like Paypal has both a graphical user interface for human users, as well as a set of web services through which you can have your own backend systems access the Paypal services.
This illustration shows a web application that contains both a graphical user interface, and a web service interface (a set of web services exposing selected functions of the web application):
|A web application with a GUI for human users, and web services for computerized clients.|
Web Service Message Exchange Patterns
There are multiple types of web services. Some web services a client calls to obtain some information. For instance, a client may call a weather web service to read weather information. These are typical read-only web services. A read-only web service may in practice send an empty request to the web service, which then sends the data back. So, even if a web service is read-only, the client might actually have to send some data (a minimal request) to the web service to obtain the data it wants to read.
Other web services are more write-only kind of web services. For instance, you may transfer data to a web service at regular intervals.
And then others are read-write services where it makes sense to both send data to the web service, and receive data back again.
All three communication patterns are illustrated here:
|Three message exchange patterns of web services: Read-only, Write-only and Read / Write .|