Sie sind auf Seite 1von 2

RESTful Web Services

REST is a term coined by Roy Fielding in his Ph.D. dissertation to describe an architecture style of networked systems. REST is an acronym standing for Representational State Transfer.

Understanding REST REST is not a protocol like SOAP is; it is an architectural design. An architecture for building services that build on HTTP.

Fundamentally different from SOAP SOAP defines a transport neutral model focused on custom operations REST defines transport specific (HTTP) model focused on resources. Builds on a uniform interface and common data formats HTTP methods: GET, POST, PUT, DELETE, etc. In SOAP we define and rely on custom service contracts / operations. In REST, we focus on defining resources and use unique URI to identify and represent these resources. Then we build services around these uniform interfaces instead of custom service contract that all services will use. So when we use HTTP to implement RESTful services, these uniform interfaces are defined by HTTP methods, i.e. GET, POST etc, so those operations that would be able to invoke on our resource. And when we get a resource then would be retrieving a representation of that resource over the protocol. So what we get is a representation of our resource and we can use a wide variety of formats to represent that resource. But in the end we will always use a uniform resource to interact with those resources that are exposed by a service. Data Formats: HTML, XML, JSON, RSS

Why is it called Representational State Transfer?


The Web is comprised of resources. A resource is any item of interest. For example, the Boeing Aircraft Corp may define a 747 resource. Clients may access that resource with this URL:

http://www.boeing.com/aircraft/747

A representation of the resource is returned (e.g., Boeing747.html). The representation places the client application in a state.

The result of the client traversing a hyperlink in Boeing747.html is another resource is accessed. The new representation places the client application into yet another state. Thus, the client application changes (transfers) state with each resource representation > Representational State Transfer.

REST

Web Services Characteristics


Here are the characteristics of REST:

Client-Server: a pull-based interaction style: consuming components pull representations. Stateless: each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server. Cache: to improve network efficiency responses must be capable of being labeled as cacheable or non-cacheable. Uniform interface: all resources are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE). Named resources the system is comprised of resources which are named using a URL. Interconnected resource representations the representations of the resources are interconnected using URLs, thereby enabling a client to progress from one state to another. Layered components intermediaries, such as proxy servers, cache servers, gateways, etc, can be inserted between clients and resources to support performance, security, etc.

Das könnte Ihnen auch gefallen