3 Engineering IoT Networks
147
3.4.3 Web Services and Representational State Transfer
(REST)
The term web service is a service offered by an electronic device to another
electronic device, communicating with each other via the World Wide Web technology [76]. In a web service, Web technologies such as HTTP or HTTPS, initially
designed for human-to-machine communication, is utilized for machine-to-machine
communication, more specifically for transferring machine-readable file formats
such as XML and JSON. Web services are usually not very optimized for low-power
and low data rate communications since they rely on HTTP/HTTPS and TCP, but
they have the advantage of being compliant with firewall-protected networks.
Web resources were first defined on the World Wide Web as documents or files
identified by their URLs. However, today they have a much more generic and
abstract definition that encompasses every thing or entity that can be identified,
named, addressed, or handled, in any way whatsoever, on the web. For instance,
a web service can consist of an object-oriented web-based interface to a database
server utilized by several sensor devices to store sensed data or to a regulator server
managing a set of actuation devices.
A first technology to implement web services was based on the Simple Object
Access Protocol (SOAP) which uses XML to encode request and response messages [77]. Such encoding mechanism revealed to be heavy even for high data rate
networks. Furthermore, according to this paradigm, the server should implement
application logic as a set of running objects whose state information should be
stored for a long time. This feature leads to high memory overhead on the server.
Both drawbacks make SOAP a non-scalable technique for large M2M applications.
A recent web service technique is called Representational State Transfer (REST).
It is a software architectural style that defines a set of constraints to implement M2M
communications by using basic HTTP operations [78]. Web services that conform
to the REST architectural style, termed RESTful web services, allow the requesting
systems to access and manipulate textual representations of web resources by using
a uniform and predefined set of stateless operations. By using a stateless protocol
and standard operations, RESTful systems aim for fast performance, reliability,
and the ability to grow, by re-using components that can be managed and updated
without affecting the system as a whole, even while it is running.
The term “representational state transfer” was introduced and defined in 2000
by Roy Fielding in his doctoral dissertation. Fielding’s dissertation explained the
REST principles based on the “HTTP object model.” The term is intended to evoke
an image of how a well-designed Web application behaves: it is a network of Web
resources (a virtual state-machine) where the user progresses through the application
by selecting links and operations such as GET or DELETE, resulting in the next
resource (representing the next state of the application) being transferred to the end
user.
In a RESTful web service, requests made to a resource’s URI will elicit a
response with a payload formatted in HTML, XML, JSON, or some other format.
Précédent

- 155/647

Suivant