JBoss Training: Programming REST Web Services with JAX-RS 2.0 - Wildfly / JBoss Developer Studio

Course #:WA2445

JBoss Training: Programming REST Web Services with JAX-RS 2.0 - Wildfly / JBoss Developer Studio

Courseware: Available for sale

This JAX-RS 2.0 training course covers the design principles of REST architecture along with the details of how to implement these services with JAX-RS 2.0. 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.

This course uses the Wildfly server and Eclipse.  Wildfly is the open source project for the JBoss Enterprise Application Platform and was renamed from JBoss Application Server (JBoss AS) for this version.  Wildfly 8 supports Java EE 7 and JAX-RS 2.0, the version covered in this course.

Topics

 
  • Primer on REST
  • Working with REST Resources
  • JAX-RS
  • Content Types in JAX-RS
  • Building JAX-RS Responses
  • Clients of JAX-RS Services
  • JAX-RS Security
  • Hypermedia and REST Services (HATEOAS)
  • Caching and Asynchronous Interaction

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
  • Use advanced hypermedia techniques supported by JAX-RS 2.0
  • Implement caching and asynchronous features of REST services

Audience

 

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


Prerequisites

 

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

  • WA1278 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.


Duration

  2 days.

Outline of JBoss Training: Programming REST Web Services with JAX-RS 2.0 - Wildfly / JBoss Developer Studio

Chapter 1. REST Services

  • Many Flavors of Services
  • Understanding REST
  • Principles of RESTful Services
  • REST Resource Examples
  • SOAP Equivalent Examples
  • REST vs SOAP Communication
  • More REST vs SOAP
  • REST vs SOAP Summary
  • Famous RESTful Services
  • Additional Resources
  • Summary

Chapter 2. Introduction to JAX-RS

  • The JAX-RS Specification
  • New In JAX-RS 2.0
  • The Resource Class
  • Configuring JAX-RS for Deployment
  • Implementing Service Versioning with Configuration
  • A Bunch of Annotations
  • @Path
  • Using Path Parameters
  • Path Parameters
  • HTTP Method Binding
  • More Complex Paths
  • Summary

Chapter 3. Other JAX-RS Data Injection

  • Sources for Injected Data
  • Query Parameters
  • HTML Form Input
  • Cookies
  • Matrix Parameters
  • HTTP Headers
  • Default Values
  • Parameter Conversion
  • Parameter Encoding
  • Custom Types
  • Bean Validation
  • Summary

Chapter 4. Designing a RESTful Service

  • Introduction
  • The Design Methodology
  • Ingredients of a Service Operation Interface
  • What Constitutes a REST Resource
  • Resource Identifiers
  • MIME Types
  • HTTP Methods
  • Example Operation Interface Document
  • Web Application Description Language (WADL)
  • WADL Support
  • Summary

Chapter 5. JAX-RS Content Types

  • Internet Media Types
  • Common Media Types
  • Use of Media Type in REST
  • The @Consumes Annotation
  • Content Negotiation
  • The @Produces Annotation
  • The MediaType Class
  • JAXB
  • Dynamic Content Negotiation
  • Summary

Chapter 6. Building Complex JAX-RS Responses

  • HTTP Response Status Codes
  • Introduction to the JAX-RS Response Class
  • Using the Response and Response.ResponseBuilder Classes
  • Building a Location for an Entity
  • Returning Cookies
  • Cookies in Response Headers
  • Reading Cookies
  • Returning an Exception
  • ExceptionMappers
  • Summary

Chapter 7. Clients of JAX-RS Services

  • Java Web Service Clients
  • JAX-RS 2.0 Client Libraries
  • JAX-RS 2.0 Client Example
  • Client Instances
  • WebTarget
  • Building and Invoking Requests
  • WADL
  • WADL Example
  • JAX-RS Implementation Client Libraries
  • RESTEasy Example
  • Summary

Chapter 8. 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
  • SecurityContext
  • Restrictions Based on Content Type
  • Summary

Chapter 9. Hypermedia and REST Services (HATEOAS)

  • HATEOAS
  • Using Hypermedia
  • Building Links and Targets
  • Using Atom Links for State Transitions
  • Summary

Chapter 10. Caching and Asynchronous Interaction

  • Caching and REST Services
  • Approaches to Caching
  • HTTP Cache Headers
  • Example: Conditional HTTP GET
  • Conditional Updates
  • Asynchronous Interaction
  • Futures and Callbacks
  • Server Asynchronous Response Processing
  • Summary