Book Image

RESTful Java Web Services - Third Edition

By : Balachandar Bogunuva Mohanram, Jobinesh Purushothaman
Book Image

RESTful Java Web Services - Third Edition

By: Balachandar Bogunuva Mohanram, Jobinesh Purushothaman

Overview of this book

Representational State Transfer (REST) is a simple yet powerful software architecture style to create lightweight and scalable web services. The RESTful web services use HTTP as the transport protocol and can use any message formats, including XML, JSON(widely used), CSV, and many more, which makes it easily inter-operable across different languages and platforms. This successful book is currently in its 3rd edition and has been used by thousands of developers. It serves as an excellent guide for developing RESTful web services in Java. This book attempts to familiarize the reader with the concepts of REST. It is a pragmatic guide for designing and developing web services using Java APIs for real-life use cases following best practices and for learning to secure REST APIs using OAuth and JWT. Finally, you will learn the role of RESTful web services for future technological advances, be it cloud, IoT or social media. By the end of this book, you will be able to efficiently build robust, scalable, and secure RESTful web services using Java APIs.
Table of Contents (11 chapters)

The description and discovery of RESTful web services

As you may know, WSDL is used for describing the functionality offered by a SOAP web service. For a SOAP web service, this is a widely accepted standard and is supported by many enterprises today. In contrast, there is no such standard for RESTful web services, and you may find different metadata formats used by various enterprises.

However, in general, you may see the following goals in common among all these metadata formats for RESTful APIs, although they differ in their syntax and semantics:

  • Entry points for the service
  • Resource paths for accessing each resource
  • Allowed HTTP methods to access these resources, such as GET, POST, PUT, and DELETE
  • Additional parameters that need to be supplied with these methods, such as pagination parameters, while reading large collections
  • Format types used for representing the request and response body contents such as JSON, XML, and TEXT
  • Status codes and error messages returned by the APIs
  • Human readable documentation for REST APIs, which includes documentation of the request methods, input and output parameters, response codes (success or error), API security, and business logic

Some of the popular metadata formats used for describing REST APIs are Web Application Description Language (WADL), Swagger, RESTful API Modeling Language (RAML), API Blueprint, and WSDL 2.0.

We will have a more detailed discussion on each of these items in Chapter 7, Description and Discovery of the RESTful Web Services.