Web Services – REST

REST Web Services YouTube Video Tutorial

Welcome to this course. This tutorial introduces you to REST APIs and explains some basic concepts.

REST Web Services 01 – Introduction
(https://www.youtube.com/watch?v=xkKcdK1u95s)

Published on 4 Oct 2014


Java Code GeeksIntroduction To REST Concepts
(https://www.javacodegeeks.com/2012/10/introduction-to-rest-concepts.html)

This post aims at demystifying the REST (Representational State Transfert) web design concepts. REST is based on a client server model. REST is a set of principles describing how standards can be used to develop web applications, for example. Its main purpose is to anticipate on common implementation issues and organize the relationship between logical clients and servers. You could call it a set of best practices!

In practice, REST provides guidance on how to implement web application interfaces to the web. Typically, one says a web application is constructed in a REST-like way or not. REST is often associated (or implemented) with HTTP, but it could be implemented with other technologies too. REST is platform and language independent.


Java Code GeeksRESTful Web Services with Java
(https://www.javacodegeeks.com/2013/11/restful-web-services-with-java.html)

REST stands for REpresentational State Transfer, was first introduced by Roy Fielding in his thesis “Architectural Styles and the Design of Network-based Software Architectures” in year 2000.
REST is an architectural style. HTTP is a protocol which contains the set of REST architectural constraints.

REST fundamentals  

  • Everything in REST is considered as a resource.
  • Every resource is identified by an URI.
  • Uses uniform interfaces. Resources are handled using POST, GET, PUT, DELETE operations which are similar to Create, Read, update and Delete(CRUD) operations.
  • Be stateless. Every request is an independent request. Each request from client to server must contain all the information necessary to understand the request.
  • Communications are done via representations. ie. XML, JSON

RESTful Web Services

RESTful Web Services have embraced by large service providers across the web as an alternative to SOAP based Web Services due to its simplicity. This post will demonstrate how to create a RESTful Web Service and client using Jersey framework which extends JAX-RS API. Examples are done using Eclipse IDE and Java SE 6.


Restlet Framework – Hello World Example
(https://www.javacodegeeks.com/2013/09/restlet-framework-hello-world-example.html)

Restlet is a lightweight, comprehensive, open source REST framework for the Java platform. Restlet is suitable for both server and client Web applications. It supports major Internet transport, data format, and service description standards like HTTP and HTTPS, SMTP, XML, JSON, Atom, and WADL. A GWT port of the client-side library is also available.


Developing RESTful Services using Apache CXF
(https://www.javacodegeeks.com/2013/07/developing-restful-services-using-apache-cxf.html)

As you already know there are two ways of developing a web service

  1. Simple Object Access Protocol (SOAP)
  2. Representational State Transfer (REST)

Before jumping on how to create a REST based web service using Apache CXF we shall see what is REST. REST is not a technology and certainly is not a standard of some kind. It is merely an architectural style that chalks down how to write a web service in a certain way. This style was defined by a certain Roy Fielding (ring bells? yep you guessed right, he is one of the architects of HTTP) in 2000. Principal protagonist of a REST architecture is a Resource which can be uniquely identified by an Uniform Resource Identifier or URI. State of a resource at any given point of time is represented by a document and is called Representation of resource. The client can update the state of resource by transferring the representation along with the request. The new representation is now returned to client along with the response.  The representation contains the information in formats like html, xml, JSON etc that is accepted by the resource. The resource which adheres to rules of REST architecture is called a RESTfull resource and web service that adheres to this rule are called RESTfull web service.


RESTful Webservices with Jersey
(https://www.javacodegeeks.com/2013/07/restful-webservices-with-jersey.html)

I have discussed my earlier article about architectural consideration<<link>> to become a RESTful system on distributed environment that are usable my system/machines. This article we are going to discuss how to build web services based on REST architecture consideration. This tutorial explains how to develop RESTful web services in Java with the Tomcat 6, Eclipse and Jersey a JAX-RS (JSR 311) reference implementation.

In a nutshell a RESTful web service is a communication between machines using HTTP on REST principles which have following key points:

  • Each resource represents unique URI to communicate over HTTP protocols
  • Each resource operation supported by HTTP methods (POST, GET, PUT and DELETE)
  • Request and Response supported by JSON, XML and various MIME type such as image, byte stream etc.

 

RESTEasy Tutorial Part-1: Basics
(https://www.javacodegeeks.com/2012/06/resteasy-tutorial-part-1-basics.html)

RESTEasy is a JAX-RS implementation from JBoss/RedHat and is in-built in JBoss 6 onwards.
Here I am going to show you how to develop a Simple RESTful Web Services application using RESTEasy and JBossAS7.1.1.FINAL.