Fast Track to REST

Fast Track to REST

Course Length: 3 days
Delivery Methods: Multiple delivery options
Course Benefits
  • Understand the purpose and role of web services in general, and how they are architected to expose business systems and processes over the web
  • Understand the concepts and principles of REST and HTTP applications
  • Expanded knowledge of HTTP, including its full set of methods and their intended uses, important headers, response codes, and content types
  • Understand REST APIs, including resource identifiers and the URI namespace, resources and subresources, and WADL
  • Understand configuration, deployment, and the runtime environment, including per-request and singleton objects, options for dependency injection, etc.
  • Understand how HTTP requests get dispatched to service methods
  • Understand content negotiation and the importance of Accept and Content-Type headers, and how they impact method dispatching
  • Bind request inputs to method parameters, including path parameters, query parameters, and headers
  • Exchange business data by communicating in HTTP entities in both XML and JSON format
  • Handle errors using Java exceptions and appropriate HTTP response codes
  • Learn how to integrate JAX-RS services with other Java EE technologies like servlets, EJB, and CDI, and how JAX-RS fits into the larger Java EE landscape
  • Write browser clients using Ajax-JavaScript
  • Write Java clients using the JAX-RS 2.0 Client API, including standalone clients and server-side components invoking remote services
  • Learn how to secure RESTful resources
Available Delivery Methods
Public Class
Public expert-led online training from the convenience of your home, office or anywhere with an internet connection. Guaranteed to run .
Private Class
Private classes are delivered for groups at your offices or a location of your choice.
Course Overview

This Fast Track to REST training class provides in-depth coverage of REST principles and building RESTful services using the JAX-RS 2.0 API. It includes a brief overview of SOAP-based services and WSDL, to provide a contrast to RESTful services.

To really understand REST, we need to remind (teach) students about the full capabilities of HTTP, since RESTful service design is centered on the innate principles and capabilities of the HTTP protocol. Stated differently, RESTful services should use HTTP the way it was originally intended, not just as GET/POST plumbing for request/response data. You will emerge from the course with a full understanding of the HTTP protocol and its vision of the "original web," and how these ideas are implemented in RESTful applications.

We'll show you how to handle the most common types of request input, culminating in the transmission of HTTP entities in both XML and JSON format, in line with the original intention of HTTP. You'll also learn how to create appropriate responses given a variety of inputs and conditions, according to the guidelines and principles in the HTTP standard.

On the client side, we look at Ajax-JavaScript clients, as well as standalone Java clients using the JAX-RS 2.0 Client API.

Your daily personal use of the web is increasingly RESTful, and this course will show you how to expose your backend business systems using REST and the innate API and capabilities of HTTP. We also take cues from the masters such as Google, examining some of their public services and using them as a backdrop in building our own.

The course is very hands-on with frequent labs, in which the student can see these ideas implemented in software.

Attendees must be experienced in Java and preferably familiar with XML, Java web applications, and other Java EE standards. Familiarity with Ajax, JavaScript, and JSON is also beneficial, but not required.

All labs are done with the Eclipse IDE Java EE version and the WildFly Application Server, and the lab instructions include detailed directions for using them. Other IDEs and servers available on request.

Course Outline
  1. Web Services Overview
    1. Definition
    2. Legacy Systems
    3. Benefits of Web Services
    4. Architecture
    5. Standards and Portability
    6. XML and Related Standards
    7. JSON
    8. HTTP
    9. SOAP-Based Services
    10. Overview
    11. SOAP Messages, Requests, and Responses
    12. WSDL
    13. Java APIs and Programming Models
  2. Introduction to REST
    1. Overview and Principles
    2. REST Characteristics
    3. Resources and Operations
    4. REST Principles
    5. Requests and Responses
    6. REST APIs
    7. URI Templates
    9. Safe and Idempotent Methods
    10. Comparison of REST and SOAP
  3. Introduction to JAX-RS
    1. APIs and Implementations
    2. JAX-RS Overview, Annotations
    3. JAX-RS Implementations
    4. Runtime Environment
    5. Application Server, Servlet-Only Container
    6. Architectural and Implementation Perspectives
    7. Configuring the Application
    8. Applications, Resources, and Providers
    9. JAX-RS Applications
    10. Resource Classes and @Path
    11. Provider Classes and @Provider
    12. Default Lifecycles
    13. The Application Class and rest-path
    14. Ajax-JavaScript Clients
    15. Overview
    16. Classic vs. Ajax Interactions
    17. Working with Ajax-JavaScript
  4. Resources and Requests
    1. Resources and Subresources
    2. Root Resource Classes, Resource Methods, Subresource Methods
    3. @GET, @POST, @PUT, @DELETE
    4. Subresource Locators
    5. Naming Conventions and Rules
    6. Dispatching Requests to Methods
    7. Binding Request Data
    8. Request Data Injection and Conversion
    9. Default Values
    10. Fields vs. Method Parameters
    11. Context-Based Injection
    12. Injection via @Context
    13. Context-Injectable Types
    14. Context Injection from the Web Container
    15. Fields vs. Method Parameters
  5. HTTP Entities
    1. Complex Content and Entities
    2. Working with Complex Content
    3. @Consumes and @Produces
    4. Content Negotiation
    5. Standard Entity Providers
    6. Working with JSON
    7. Returning Data as JSON
    8. Working with JSON in JavaScript
    9. Processing JSON Responses
    10. Working with XML
    11. JAXB and Mapping to XML
    12. Returning Data as XML
    13. Working with XML on the Client
    14. Customizing Content, Custom Media Types
    15. Working with Collections
    16. XML vs. JSON
  6. Responses
    1. Response Class
    2. Return Types and HTTP Response Codes
    3. Appropriate Responses for HTTP Methods
    4. Choosing the Right Response
    5. Error Handling
    6. Exception Mappers
    7. WebApplicationException
    8. Response vs. Thrown Exception
    9. Error Responses
    10. Subresource Locators
    11. Motivation and Uses
    12. Locating the Locator
    13. Initializing the Subresource
    14. Binary Content
    15. File, InputStream, StreamingOutput
    16. Using StreamingOutput
  7. Java Client API
    1. Java Client - Options and Ingredients
    2. Building and Sending the Request
    3. Consuming the Response
    4. Options for the Response Data
    5. Asynchronous Requests
  8. SIntegration with Java EE
    1. Integration with EJB
    2. CDI - Contexts and Dependency Injection
    3. Activation, Scopes, and JAX-RS Lifecycles
    4. Injection in CDI-Enabled JAX-RS Applications
    5. Enhanced Java EE Lifecycle
  9. Security
    1. Java EE Security Overview
    2. Security Requirements in JAX-RS
    3. Declarative, Role-Based Security
    4. Security Constraints
    5. Annotation-Based Security
    6. Authentication
    7. Configuration
    8. Authentication Models: Basic, Digest, Client-Cert
    9. Programmatic Security
    10. SecurityContext
    11. Client Security
    12. HTTPS
Class Materials

Each student will receive a comprehensive set of materials, including course notes and all the class examples.

Register for a Live Class
Please select a class.
Request a Private Class
  • Private Class for your Team
  • Online or On-location
  • Customizable
  • Expert Instructors
Request Pricing