Providing Technology Training and Mentoring For Modern Technology Adoption
Web Age Aniversary Logo
US Inquiries / 1.877.517.6540
Canadian Inquiries / 1.877.812.8887
Course #:WA2002

Mastering JAX-RS REST Web Services and AJAX Clients - WebSphere 8.0 / RAD 8.0 Training

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. Also covered are how to implement AJAX clients of RESTful services sending various data formats.

The Java JAX-RS specification covers how to implement RESTful services with Java. This specification is driven by annotations and can be leveraged from many different environments, including a Java EE 'Application Server'. With the recent inclusion of the JAX-RS specification in the Java EE 6 umbrella of technologies implementing RESTful services with JAX-RS will become even easier.

It is also common to use an AJAX client with RESTful services. These clients are implemented in JavaScript so that browser-based applications can communicate with REST services to obtain data enabling a rich, Web 2.0 client experience.


  • 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
  • AJAX Review
  • JavaScript DOM Review
  • Consuming RESTful services with AJAX
  • Formatting and styling service response data
  • Working with secure services

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
  • Consume REST services using AJAX
  • Format and style XHTML-compliant service data using CSS, XSLT, or both
  • Interact with secure data services



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



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:

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


  4 days.

Outline of Mastering JAX-RS REST Web Services and AJAX Clients - WebSphere 8.0 / RAD 8.0 Training

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
  • The Resource Class
  • A Bunch of Annotations
  • @Path
  • Using Path Parameters
  • HTTP Method Binding
  • More Complex Paths
  • Configuring JAX-RS for Deployment
  • Summary

Chapter 3. JAX-RS Data Injection

  • Sources for Injected Data
  • Path Parameters
  • Query Parameters
  • HTML Form Input
  • Cookies
  • Matrix Parameters
  • HTTP Headers
  • Default Values
  • Parameter Conversion
  • Custom Types
  • 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
  • Summary

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
  • 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
  • Example: Conditional HTTP GET
  • Returning Cookies
  • Cookies in Response Headers
  • Reading Cookies
  • Returning an Exception
  • ExceptionMappers
  • Summary

Chapter 7. 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
  • Summary

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
  • WADL
  • WADL Example
  • Summary

Chapter 9. Introduction to AJAX

  • What is AJAX?
  • A Simple Example
  • The Old Way
  • The AJAX Way
  • Two Key Aspects of AJAX
  • What are the Advantages of the AJAX Approach?
  • AJAX Technologies
  • The Basic AJAX API
  • Creating the XMLHttpRequest Object
  • The XMLHttpRequest Object Basics
  • Complete Example
  • The Timeline
  • Review Questions
  • Review Answers

Chapter 10. AJAX API Details

  • The Request Object
  • Creating the Request Object
  • Properties of the Request Object
  • Methods of the Request Object
  • Simple GET Example
  • Making a POST Request
  • Making Concurrent Requests
  • Memory Leak With Inner Function
  • A POST Utility Function
  • Mozilla XmlHttpRequest Extensions
  • IE Microsoft.XMLHTTP Extensions
  • Ajax Caching
  • Control Cache Duration
  • Advanced Cache Control
  • Summary

Chapter 11. JavaScript DOM API

  • What is DOM?
  • Element Hierarchy
  • DOM Standardization
  • The Document Object
  • Nodes and Elements
  • The Element Object
  • Element Event Handlers
  • The window Object
  • The Frame Object
  • The History Object
  • Summary

Chapter 12. Communication With Server - Basic

  • Introduction
  • Application Layer Protocol
  • Choosing a Data Format
  • Plain HTML Snippet
  • XML Document
  • XML Document – Server Side
  • Example: Build DOM Document in Java
  • Example: Write DOM Document in HTTP Reply
  • Example: The Servlet
  • C#: Create a XML DOM Document
  • C#: Output XML in HTTP Reply
  • XML Document - Client Side
  • DOM API Summary
  • DOM API – The Document Object
  • DOM API – The Element Object
  • Body Text of an Element
  • Setting Body Text
  • Displaying Body Text
  • Using XML As Request Data
  • Creating a New DOM Document
  • Serializing DOM Document as Text
  • Posting an XML Document
  • Processing the Posted XML From a Servlet
  • Summary

Chapter 13. Communication With Server - JSON

  • Introduction
  • JavaScript Object Notation (JSON)
  • JSON Syntax
  • How Does JSON Based Communication Work?
  • How Does JSON Based Communication Work?
  • JSON: Server Side
  • JSON: Client Side
  • Working With Arrays
  • Advanced JSONObject Methods
  • Advanced JSONArray Methods
  • Summary

Chapter 14. 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
We regularly offer classes in these and other cities. Atlanta, Austin, Baltimore, Calgary, Chicago, Cleveland, Dallas, Denver, Detroit, Houston, Jacksonville, Miami, Montreal, New York City, Orlando, Ottawa, Philadelphia, Phoenix, Pittsburgh, Seattle, Toronto, Vancouver, Washington DC.
US Inquiries / 1.877.517.6540
Canadian Inquiries / 1.877.812.8887