Choose your language:

France
Germany
Hong Kong
India
Ireland
Japan
Malaysia
Netherlands
New Zealand
Singapore
Sweden
United Kingdom
United States

Programming Java Soap and Rest Web Services - JBOSS/Eclipse

Course Code

IN1529

Duration

5 Days

Experience with Java programming is required. Experience with Eclipse 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.
This course covers how to implement web services with JBoss 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 JBoss.
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.

Upon completion of this course, participants will 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 Eclipse and JBoss.
  • 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
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
Summary

CHAPTER 2. BASIC XML SCHEMAS
What is XML Schema ?
Goals of Schema
Converting DTDs to Schema
Recall: Namespaces
The equivalent schema
Sample instance document
Documents Needed
XML Schema Namespaces
Link Documents to Schemas
Inline element declarations
Schema Data Types
Schema Type Definitions
Schema Simple Data Types
Primitive Data Types
Simple Types
Facet – Restrictions on Element Content
Using the Facet
More Samples
Define Simple Element Type
Element Declaration
Element Occurrence Indicators
Complex Type
Attribute Declaration
Attribute Declarations
Occurrence of Attributes
Value Constraints on Attributes
Sequence Element
Element Choices
Express any order
Annotations

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
Summary

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
Summary

CHAPTER 5. WEB SERVICES DESCRIPTION LANGUAGE (WSDL)
WSDL Overview
WSDL Syntax Overview
<definitions>
<import>
<types>
<message>
<portType>
<operation>
<binding>
<service>
Summary

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

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

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

CHAPTER 9. 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 10. BUILDING AN EJB BASED WEB SERVICE
Introduction
Why Use EJB as Service Implementation?
Implementing EJB Web Service
Using a Service Endpoint Interface (SEI)
Summary

CHAPTER 11. ERROR HANDLING
Introduction
Fault
Designing Faults
System Problems
Business Rule Violation
Summary

CHAPTER 12. JBOSS WEB SERVICES AND CLIENTS
JBoss Web Service Deployment
Routing Web Service Requests
JBoss Web Service Deployment Descriptor
Writing Portable Web Service Clients for JBoss
Using a Packaged WSDL
Managed Web Service Clients
JBoss @WebServiceRef Customization
JBoss Web Service Tools
Summary
Reference

CHAPTER 13. ADVANCED JBOSS WEB SERVICE FEATURES
JAX-WS + WS-*
Apache CXF Support for WS-*
Implementation Choices
Using WS-Policy for Advanced Features
Using Apache CXF API for Advanced Features
Using Apache CXF Configuration for Advanced Features
So Which to Use?
Supplying Apache CXF Configuration File
Using jbossws-cxf.xml File
Installing Spring Modules for JBossWS
Setting Classpath Dependencies
Summary

CHAPTER 14. 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 15. 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 16. 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 17. 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 18. 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
Summary

CHAPTER 19. 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 20. 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 21. 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
Summary

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

CHAPTER 23. 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
Summary
Send Us a Message
Choose one