The Web was originally created to support interactive communication. People use the Web to communicate with other people and to access information. You use e-mail and instant messaging to converse with friends and colleagues. You use a browser to access information.
In the early days of the Web, a Web site was simply a set of static pages that were stored in files. You could view only the text and pictures contained in these files. To change what users saw, a Web site operator had to edit the files. Soon we realized that we could also use the Web to access dynamic information. When you link to a dynamic page, the Web server doesn't merely display a file. Instead it calls an application that dynamically generates and renders the requested information. The introduction of this technique marked the point when the Web evolved to allow people to talk to applications.
Web services represent the next step in the Web's evolution because they allow applications to talk to applications. Web-based application-to-application integration allows us to exploit the universal connectivity and immense scalability of the Web, and it supports a much richer set of usage models than do human-oriented applications.
Figure 2-2 summarizes the differences between a Web site and a Web service. A Web site represents a group of Web resources that are designed to be accessed by humans, and a Web service represents a group of Web resources that are designed to be accessed by applications.
Figure 2-2. A Web site is designed to be accessed by humans. A Web service is designed to be accessed by applications.
The interfaces to these two types of applications are fundamentally different. A Web site supports human clients who have a tremendous capacity to interpret the meaning of information. The site returns information as a Hypertext Markup Language (HTML) page—a string of text containing formatting information, often including graphics, clickable buttons, and links. A human interprets this information based on visual layout and physical association. In contrast, an application can't interpret information this way. An application needs unambiguous information. It needs to know what programmatic functions are available, and it needs to know how to structure and interpret the data being exchanged. A Web API defines these programmatic functions and data structures in a completely unambiguous way.