What is REST and RESTful Webservices .
- REpresentational State Transfer (REST) was introduced in early 2000 by Roy Fielding's.
- REST means Representational State Transfer, which is an architectural style for distributed hypermedia systems.
- There was no official standard for RESTful web APIs until the JSR 311(JAX-RS) specification was finalized in 2008.
- REST is an architectural style.
- In the REST architectural style, data and functionality are considered as resources,and these resources are accessed using Uniform Resource Identifiers (URIs), typically links on the web.
- A service which is implemented based on REST is called a RESTful service.
- RESTful webservices mainly used to build Web services that are lightweight, maintainable, and scalable.
- RESTful service uses mainly stateless HTTP as its underlying protocol.
- RESTful service also uses the standard HTTP methods(GET,POST,PUT,DELETE) to send and receive data from remote servers.
Different HTTP verbs and usage
GET :
-Retrieve all resources in a collection if the scope is colection.
-Retrieve a single resource if the scope is resource.
POST :
-Create a new resource in a collection if the scope is colection.
PUT :
-Update a resource if the scope is resource.
DEETE :
-Delete a resource if the scope is resource.
Features of RESTful webservices
- Support different messages formats like XML,HTML ,plain text, PDF, JPEG and JSON
- Resource identification through URI's
- Uniform interface through the methods GET,POST,PUT and DELETE
- Stateless communication to transmitting the data..means we need to send the proper requested data to the server
- We can configure proxy servers, cache servers between the clients and the resources to achieve performance and security.
Different Implementations of JAX-RS include:
1) Apache CXF, an open source Web service framework
2) Jersey, the reference implementation from Sun (now Oracle)
3) RESTeasy, JBoss's implementation
4) Restlet
5) Apache Wink, Apache Software Foundation Incubator project, the server module implements JAX-RS
6) WebSphere Application Server from IBM
7) WebLogic Application Server from Oracle