Course Description

This course covers the design principles of REST architecture along with the details of how to implement these services with JAX-RS. This will allow students who take the course to implement RESTful services using Java standards that will be portable to many different Java environments.

Although many of the services in active use are SOAP or at least XML-based, an increasing number of services take a RESTful approach to data transmission. Representational state transfer (REST) is a style of software architecture that differs from the more traditional Remote Procedure Call (RPC) style of data transmission, instead emphasizing the importance of defining and retrieving representations of resources.

Labs are done using the new Eclipse tools for WebSphere.


  • Primer on REST
  • Working with REST Resources
  • JAX-RS
  • Content Types in JAX-RS
  • REST vs SOAP
  • Building JAX-RS Responses
  • Clients of JAX-RS Services
  • JAX-RS Security

What you will learn

After completing this course, the student should be able to:

  • Understand the REST style of software architecture
  • Describe the advantages and disadvantages of applying RESTful design strategies to various scenarios
  • Implement RESTful services using the JAX-RS Java specification
  • Create JAX-RS services that use various types of request/response content
  • Compare and contrast REST with RPC, SOAP, and other similar communication strategies
  • Apply fine-grained control of the responses returned from JAX-RS services
  • Use various techniques to implement clients of RESTful services
  • Apply Java EE security to JAX-RS services



2 days


Target Audience

This course is applicable for Architects and Developers that need to design and develop RESTful web services using JAX-RS.


Course Prerequisites

Experience with Java programming is required. Experience with Eclipse/RAD is useful but not required. For those that might need this Java or Eclipse/RAD experience the following course is suggested:

GTJ01 – Introduction to Java Using Eclipse

An understanding of basic web architecture and the HTTP protocol. Prior experience with RPC-style services such as Web services, Java RMI, COM objects, etc. is helpful, but not required.

If you have any questions or doubts as to whether you meet the pre-requisites for this course, or indeed are wondering which course best suits you, please consult with us to discuss your suitability for course attendance.


Suggested Follow on Courses

There are a number of options of suitable follow-on courses, depending on your business needs. Please Contact Us for further details.


Course Content

Chapter 1. REST Services

Many Flavors of Services

Understanding REST

Principles of RESTful Services

REST Resource Examples

SOAP Equivalent Examples

REST vs SOAP Communication



Famous RESTful Services

Additional Resources

Chapter 2. Designing a RESTful Service


The Design Methodology

Ingredients of a Service Operation Interface

What Constitutes a REST Resource

Resource Identifiers

MIME types

HTTP Methods

Example Operation Interface Document

Chapter 3. Introduction to JAX-RS

The JAX-RS Specification

The Resource Class

A Bunch of Annotations


More Complex Paths

Using Path Parameters

HTTP Binding


Chapter 4. JAX-RS Data Injection

Sources for Injected Data

Path Parameters

Query Parameters

HTML Form Input


Matrix Parameters

Http Headers

Default Values

Parameter Conversion

Custom Types

Chapter 5. JAX-RS Content Types

Internet Media Types

Use of Media Type in REST

The @Consumes Annotation

Content Negotiation

The @Produces Annotation

The MediaType Class


Dynamic Content Negotiation

Chapter 6. REST vs. SOAP

Defining REST

The Six REST Architectural Style Constraints

The Four REST Interface Constraints

Hypermedia Examples

Defining SOAP


Document SOAP vs. REST

Where SOAP Shines

Where REST Shines

Selecting an Appropriate Solution

Chapter 7. Building Complex JAX-RS Responses

HTTP Response Status Codes

Introduction to the JAX-RS Response Class

Using the Response and Response.ResponseBuilder Classes

Example: Conditional HTTP GET

Returning Cookies

Cookies in Response Headers

Reading Cookies

Returning an Exception


Chapter 8. Clients of JAX-RS Services

Java Web Service Clients

Apache HttpClient

More Apache HttpClient Code

JAX-RS Implementation Client Libraries

RESTEasy Example


Building Links with UriBuilder and UriInfo

Using Atom Links for State Transitions


Chapter 9. Securing JAX-RS Services

HTTP Basic Authentication

Example Client

The WWW-Authenticate and Authorization Headers

Java EE Security Roles

Integration with Web Container Security

Java EE Security Annotations


Restrictions Based on Content Type


See more Web Services courses