This 3 day class shows experienced Java programmers how to build RESTful web services using the Java API for RESTful Web Services, or JAX-RS. We begin with an overview of web services development in the Java EE platform, including SOAP, WSDL, REST; JAX-WS, JAXB, and JAX-RS. Then students learn to work with JAXB to bind Java object models to XML Schema. The bulk of the course is devoted to study of JAX-RS: students work with the Jersey implementation of JAX-RS to create RESTful services from simple single-value interactions to more sophisticated services that manage CRUD (create/retrieve/update/delete) operations on more complex data types, using JAXB to marshal and unmarshal data over the wire.
Goals
- Understand the advantages of the REST architecture for web services.
- Use JAX-RS to develop simple RESTful services.
- Control dispatching to service methods based on URL patterns and HTTP methods.
- Bind request values to method parameters when expressed as HTTP query parameters, form values, headers, cookies, and more.
- Manage XML content using XML Schema and JAXB.
- Incorporate XML entities into service input and output.
- Take advantage of lifecycle and context services available to JAX-RS services as Java EE components.
Outline
- Overview of Web Services
- Why Web Services?
- Service-Oriented Architecture
- HTTP and XML
- SOAP
- WSDL
- The SOAP Vision
- The REST Vision
- UDDI
- The WS-I Basic Profile
- Security
- Web Services for Java EE
- Hosting Web Services: Scenarios
- Web Services for Java EE
- JAX-WS and JAXB
- Web-Services Metadata
- WSDL-to-Java and Java-to-WSDL Paths
- Provider and Dispatch APIs
- SAAJ and JAXP
- JAX-RS for RESTful Services
- JAXR
- The Java API for XML Binding
- The Need for Data Binding
- XML Schema
- Two Paths
- JAXB Compilation
- Mapping Schema Types to Java
- Java-to-XML Mapping Using Annotations
- Marshaling and Unmarshaling
- Working with JAXB Object Models
- The Java API for RESTful Services
- Applications
- Resources
- Sub-Resources
- Providers
- Scanning and @ApplicationPath
- Dispatching Requests to Methods
- The Application Path
- The @Path Annotation
- The HTTP Method Annotations
- Sub-Resource Locators
- Annotation Inheritance and overriding
- Parameter and Return Types
- Simple Parameter Types
- @Consumes and @Produces Annotations
- @XXXParam Annotations
- The @DefaultValue Annotation
- Return Types
- Binary Content
- Delivering a File
- Entities and Complex Content
- Entity Providers
- Built-In Entity Providers
- Working with XML
- Driving XML Representations from Schema
- Context and Lifecycle
- Reading Web Resources
- Finding Java EE Components
- Finding Databases
- Security Contexts
To Hire an AMS Java Web Services Subject Matter Expert and Instructor who also teaches this class, call us today at 800-798-3901