
defines the unique identifier or primary key of the relation. Persistence provider, EclipseLink, which comes bundled with Glassfish, recognizes it and transforms it into an entity from simple POJO. The JPA annotation makes any simple POJO a persistence class. This simple Java class represents the Book entity and maps the BOOK_LIB table into the database. Here, we will have four classes, namely, Book.java, Books.java, BookService.java and ApplicationConfig.java. Let’s implement the server or resource producer first.

Readers may also refer – Creating SOAP Web Service with JAX-WS to appreciate the differences and similarities in creating ‘Web Services’ in SOAP (JAX-WS) and REST (JAX-RS).įig 1: JAX-RS RESTful communication between Client and Server Here we focus on ‘creating JAX-RS’, the RESTful implementation of Java. Refer to Fielding’s Ph D dissertation for an in depth understanding. Obviously, a one line explanation would be a ludicrous definition of such a robust and extensible architecture. Information is regarded as ‘resources’ addressed through URI (Uniform Resource Identifier). Plain and simple, REST is built over HTTP for a distributed, collaborative, document based system.

The orchestra of intermingling technologies working together in SOAP is absent here.

RESTful (Representational State Transfer) Web Services are not protocol specific. Creating RESTful Web Services with JAX-RS
