What are RESTful Web Services?
REST stands for REpresentational State Transfer, which was first introduced by Roy Fielding in his thesis "Architectural Styles and the Design of Network-based Software Architectures" in 2000.
In Java EE 6, JAX-RS provides the functionality for RESTful web services. REST is well suited for basic, ad hoc integration scenarios, often better integrated with HTTP than SOAP-based services are, do not require XML messages or WSDL service–API definitions.
In the web services terms, REpresentational State Transfer (REST) is a stateless client-server architecture in which the web services are viewed as resources and can be identified by their URIs. Web service clients that want to use these resources access via globally defined set of remote methods that describe the action to be performed on the resource.
REST is an architectural style and HTTP is a protocol which contains the set of REST architectural constraints. Below are some fundamentals one should remember:
- Everything in REST is considered as a resource.
- Every resource is identified by an URI.
- It uses uniform interfaces. Resources are handled using POST, GET, PUT, DELETE operations which are similar to Create, Read, update and Delete(CRUD) operations.
- The REST web services are completely stateless and every request is an independent request. Each request from client to server must contain all the information necessary to understand the request.
- Client-Server communications are done via representations. E.g. XML, JSON
Now let us see some of features RESTful web services provides:
- Resource identification through URI
- Uniform interface
- Caching Implementation
- Named resources
- Interconnected resource representations
- Layered components
- Self-descriptive messages