PROGRAMMING JAVA SOAP AND REST WEB SERVICES – WEBSPHERE 8.0 / RAD 8.0 – GTJ12

Course Description

This course covers how to implement web services with WebSphere 8.0 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.0.

This course is also available using Eclipse IDE.

After completing this course, the student should be able to:

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

^^

Duration

5 days

^^

Target Audience

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

^^

Course Prerequisites

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:

GTJ01 – 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.

^^

Suggested Follow on Courses

There are a number of options of suitable follow-on courses, depending on your business needs. Please contact us for further details.

^^

Course Content

CHAPTER 1. 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

CHAPTER 2. 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

CHAPTER 3. 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

CHAPTER 4. 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

CHAPTER 5. WEB SERVICES DESCRIPTION LANGUAGE (WSDL)

WSDL Overview

WSDL Syntax Overview

<definitions>

<import>

<types>

<message>

<portType>

<operation>

<binding>

<service>

Summary

CHAPTER 6. 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

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

CHAPTER 8. 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

CHAPTER 9. 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

CHAPTER 10. BUILDING AN EJB BASED WEB SERVICE

Introduction

Why Use EJB as Service Implementation?

Implementing EJB Web Service

Using a Service Endpoint Interface (SEI)

CHAPTER 11. ERROR HANDLING

Introduction

Fault

Designing Faults

System Problems

Business Rule Violation

CHAPTER 12. 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

CHAPTER 13. 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

CHAPTER 14. 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

CHAPTER 15. 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

CHAPTER 16. 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

CHAPTER 17. 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

CHAPTER 18. 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

CHAPTER 19. 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

CHAPTER 20. 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

CHAPTER 21. 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

CHAPTER 22. 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

^^

See more Java courses