WA2098

Programming Java SOAP and REST Web Services - WebSphere 8.5 / RAD 8.5 Training

This course covers how to implement web services with WebSphere 8.5 using the most recent Java standards, JAX-WS for SOAP web services and JAX-RS for REST web services.  Since it is possible to use both styles of web services, even within the same application, this course will show the student the strengths of both styles and how to properly implement both types of web services.  Testing web services is also more difficult than "normal" web applications so this course covers tools and techniques used to test web services in the labs. This course will be particularly useful for those looking to upgrade existing JAX-RPC Java web services and who want to know the different styles of web services now supported by WebSphere 8.5.
Course Details

Duration

5 days

Prerequisites

  • Experience with Java programming is required.
  • Experience with Eclipse/RAD is useful but not required.
  • 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.

Target Audience

Architects and Developers that need to design and develop SOAP web services using JAX-WS and RESTful web services using JAX-RS.

Skills Gained

  • Confidently design XML schema and WSDL.
  • Tell the difference between different SOAP styles (document literal, RPC literal etc.)
  • Implement a Web Service using RAD 8.5 and WebSphere.
  • Write a Web Services client using standard Java specifications.
  • Secure JAX-WS web services.
  • 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
  • Use various techniques to implement clients of RESTful services
  • Apply Java EE security to JAX-RS services
Course Outline
  • Overview of Java Web Services
    • A Conceptual Look at Services
    • Defining Services
    • Benefits of Web Services
    • Many Flavors of Services
    • Java Web Service Implementation Choices
    • Future of JAX-RPC
    • Java SOAP Web Services with JAX-WS
    • Java REST Web Services with JAX-RS
    • REST vs SOAP Summary
    • Java and XML with JAXB
    • Java Web Service Clients
  • Introduction to Schema
    • What is an XML Schema?
    • Instance Documents
    • A Simple Instance Document
    • Creating a Schema File
    • Defining a Simple Element
    • Defining a Complex Element
    • Defining Element Attributes
    • Referring to an Element From Another Element
    • Adding Restrictions
    • Putting It All Together
    • Referring to a Schema from an XML Document
    • Global Elements vs. Local Elements
  • The Java Architecture for XML Binding (JAXB)
    • Introduction to JAXB
    • Overview of Data Binding
    • JAXB Architecture
    • Binding Example
    • Binding Framework Example
    • Java and XML Mapping Overview
    • Namespace and Package Name Mapping
    • Simple Type Mapping
    • Complex Type Mapping
    • Customizing Complex Type Mapping
    • Property Accessor Customization
    • Property Mapping Customization
    • XML Element Mapping
    • Mapping Java Enums
    • Mapping Collections
    • Generating Java Class and Schema
    • Marshalling and Unmarshalling
  • Introduction to JAX-WS
    • What is JAX-WS?
    • Advantages of JAX-WS
    • Why Do We Need a Programming Model?
    • Basic Java to WSDL Mapping
    • Developing a Service Provider
    • The Service Implementation Class
    • The Service Endpoint Interface (SEI)
    • Service Implementation Options
    • Developing a Consumer
    • Static Client Development
    • The Service Class
    • The BindingProvider Interface
  • Web Services Description Language (WSDL)
    • WSDL Overview
    • WSDL Syntax Overview
    • <definitions>
    • <import>
    • <types>
    • <message>
    • <portType>
    • <operation>
    • <binding>
    • <service>
  • Simple Object Access Protocol (SOAP)
    • SOAP Overview
    • SOAP in Protocol Stack
    • SOAP Document Components
    • Example SOAP Request Document
    • Example SOAP Response Document
    • The <Envelope> Element
    • The <Header> Element
    • The <Body> Element
    • SOAP Communication Style
    • Communication Style Example
    • Setting the Style in WSDL
    • RPC/Encoded Style
    • RPC/Literal Style
    • Document/Literal Style
    • Document/Literal Wrapped Style
  • Web Services Interoperability (WS-I)
    • Introduction
    • Goal
    • What Comes out of WS-I?
    • WS-I Tools
    • Profiles
    • WS-I Messaging
    • Messaging Highlights
    • Service Description
    • Service Description Highlights
    • Service Publication/Discovery
    • Security
    • .NET Interoperability
  • JAX-WS Mapping Details
    • Introduction to Mapping in JAX-WS
    • Top-down and Bottom-up Mapping
    • WSDL to Java Mapping
    • XML Data Type to JavaBean Mapping
    • Mapping <portType> to the SEI
    • Mapping the SOAP <binding>
    • Customizing WSDL to Java Mapping
    • Java to WSDL Mapping
    • JavaBean to XML Mapping
    • Mapping SEI to <portType>
    • Mapping Java Method to <operation>
    • Input Parameter Mapping
    • Method Output Mapping
    • Bare Input and Output Mapping
    • RPC Literal Style
    • Service Provider Annotation
    • Web Service Provider Example
    • Service Provider Annotations
    • JAX-WS Clients
    • Synchronous and Asynchronous Calls
  • Advanced JAX-WS API
    • Publishing a Web Service
    • Web Service Context
    • Message Context
    • Working With Raw XML
    • Raw XML: Server Side
    • XML Handling Strategies
    • Raw XML: Client Side
  • Building an EJB Based Web Service
    • Introduction
    • Why Use EJB as Service Implementation?
    • Implementing EJB Web Service
    • Using a Service Endpoint Interface (SEI)
  • Error Handling
    • Introduction
    • Fault
    • Designing Faults
    • System Problems
    • Business Rule Violation
  • Managed Web Service Client Binding
    • Using a Packaged WSDL
    • Managed Web Service Clients
    • Injecting the Service Port Directly
    • Web Service Administration Tasks
    • Configure Endpoint URL in Consumer Side
    • Configure Endpoint URL in Provider Side
    • Publishing WSDL File
    • Working with Policy Sets
    • Stopping a Service Listener
  • Web Services Security (WS-Security)
    • The Challenges
    • Public Key Infrastructure (PKI)
    • Digital Signature
    • Certificates
    • Overview of Web Services Security
    • SOAP Message Security
    • Message Integrity
    • Message Confidentiality
    • Symmetric Encryption Example
    • Authentication Using Identity Token
    • Authentication
    • Transport Level Security
    • Audit Tracking
    • Identity Assertion Using SAML
    • SAML SOAP Example
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Clients of JAX-RS Services
    • Java Web Service Clients
    • Apache HttpClient
    • More Apache HttpClient Code
    • JAX-RS Implementation Client Libraries
    • RESTEasy Example
    • HATEOAS
    • Building Links with UriBuilder and UriInfo
    • Using Atom Links for State Transitions
    • WADL
    • WADL Example
  • 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
  • REST vs. SOAP
    • Defining REST
    • The Six REST Architectural Style Constraints
    • The Four REST Interface Constraints
    • Hypermedia Examples
    • Defining SOAP
    • RPC SOAP vs. REST
    • Document SOAP vs. REST
    • Where SOAP Shines
    • Where REST Shines
    • Selecting an Appropriate Solution
  • Lab Exercises
    • Lab 1. WebSphere Workspace Configuration
    • Lab 2. Introduction To Web Services
    • Lab 3. Creating An XML Schema
    • Lab 4. JAXB Programming
    • Lab 5. Create A Bottom Up Web Service
    • Lab 6. Creating A WSDL File
    • Lab 7. Creating A Top-Down Web Service
    • Lab 8. Developing A Web Service Client
    • Lab 9. Monitoring SOAP Messages
    • Lab 10. Controlling JAXB Mappings
    • Lab 11. Develop EJB Based Service
    • Lab 12. Handle Web Service Faults
    • Lab 13. Managed Service Client
    • Lab 14. Getting Setup for WS-Security
    • Lab 15. Message Integrity using WS-Security
    • Lab 16. Message Confidentiality
    • Lab 17. Develop a Simple RESTful Service
    • Lab 18. Extracting Information from a HTTP Request
    • Lab 19. Designing a RESTful Service
    • Lab 20. Add Support for XML Format
    • Lab 21. Add Support for JSON
    • Lab 22. Build the Order Web Service
    • Lab 23. Complete the Order Service
    • Lab 24. Developing a JAX-RS Client
    • Lab 25. Securing RESTful Services