Web Service Concepts
9.1 WEB SERVICE CONCEPTS
Web services are typically described as communication between business servers, typically initiated by the interaction of a user through a web site. We make no exception to this, because this not only typifies the behavior of the web service technology, but also highlights the machine-to-machine communication aspects of web services.
Figure 9.1 is a canonical example of web service technology in action. In this figure a user is interacting with the web site of a travel agent through a web browser. Although this part uses the World Wide Web, it is not where web services are used. Rather, web services enter where the interaction between the user and the web site ends.
FIGURE 9.1 A traditional example of a web service transaction. A human user uses the travel agent's web site to look for flights. The travel agent server uses web service technology to query multiple airlines for possible routes and gets several results.
Web services are used as a communication mechanism between the travel agent's server and other servers that it communicates with to achieve its task. Neither the travel agent's server nor the airlines' servers are run by the same parties, so web services provide an intermediary that allows them to exchange data without in-between translation, since all servers adhere to the web services framework.
The travel agent's server sends a series of web service requests to a number of servers that belong to airline companies. The travel agent server receives replies from a number of them; in this case one from SAS and one from KLM. The travel agent server can then format these replies and present them to the user. The presentation of the data is independent of the format in which the data were sent between the airline servers and the agent server.
The example in Figure 9.1 illustrates how web services work, but not how they relate to smart objects. To shift the focus back to smart objects, Figure 9.2 shows an example of a smart object system realized through web services.
FIGURE 9.2 A smart object system implemented with web services. Temperature sensors post temperature data to a building automation server. The building automation server configures a radiator based on the temperature data.
In this example, a building automation server is connected to a network of temperature sensors and radiators. The sensors and radiators are located in a building and connected either to a wireless network or a wired in-house network. The particular communication technology used does not matter, because the system is built on IP.
The temperature sensors periodically post their temperature data to the building automation server using a web services framework. This allows the building automation server and the temperature sensors to be provided by different vendors since they both agree on a common communication mechanism and data format. The server may also query the sensors to get the current temperature value.
After the building automation server has received the temperature data from the house's temperature sensors, it uses this information to control the radiator. The radiator has a smart object with web service communication abilities, and the building automation server posts a configuration request to the radiator. The radiator updates its setting to match the value requested by the automation server.
FIGURE 9.3 An XML document.