Menu Close Apache CXF Development Guide I. Writing WSDL Contracts Expand section "I. Writing WSDL Contracts" Collapse section "I. Writing WSDL Contracts" 1. Introducing WSDL Contracts Expand section "1. Introducing WSDL Contracts" Collapse section "1. Introducing WSDL Contracts" 1.1. Structure of a WSDL document 1.2. WSDL elements 1.3. Designing a contract 2. Defining Logical Data Units Expand section "2. Defining Logical Data Units" Collapse section "2. Defining Logical Data Units" 2.1. Introduction to Logical Data Units 2.2. Mapping data into logical data units 2.3. Adding data units to a contract 2.4. XML Schema simple types 2.5. Defining complex data types Expand section "2.5. Defining complex data types" Collapse section "2.5. Defining complex data types" 2.5.1. Defining data structures 2.5.2. Defining arrays 2.5.3. Defining types by extension 2.5.4. Defining types by restriction 2.5.5. Defining enumerated types 2.6. Defining elements 3. Defining Logical Messages Used by a Service 4. Defining Your Logical Interfaces II. Web Services Bindings Expand section "II. Web Services Bindings" Collapse section "II. Web Services Bindings" 5. Understanding Bindings in WSDL 6. Using SOAP 1.1 Messages Expand section "6. Using SOAP 1.1 Messages" Collapse section "6. Using SOAP 1.1 Messages" 6.1. Adding a SOAP 1.1 Binding 6.2. Adding SOAP Headers to a SOAP 1.1 Binding 7. Using SOAP 1.2 Messages Expand section "7. Using SOAP 1.2 Messages" Collapse section "7. Using SOAP 1.2 Messages" 7.1. Adding a SOAP 1.2 Binding to a WSDL Document 7.2. Adding Headers to a SOAP 1.2 Message 8. Sending Binary Data Using SOAP with Attachments 9. Sending Binary Data with SOAP MTOM Expand section "9. Sending Binary Data with SOAP MTOM" Collapse section "9. Sending Binary Data with SOAP MTOM" 9.1. Overview of MTOM 9.2. Annotating Data Types to use MTOM 9.3. Enabling MTOM Expand section "9.3. Enabling MTOM" Collapse section "9.3. Enabling MTOM" 9.3.1. Using JAX-WS APIs 9.3.2. Using configuration 10. Using XML Documents III. Web Services Transports Expand section "III. Web Services Transports" Collapse section "III. Web Services Transports" 11. Understanding How Endpoints are Defined in WSDL 12. Using HTTP Expand section "12. Using HTTP" Collapse section "12. Using HTTP" 12.1. Adding a Basic HTTP Endpoint 12.2. Configuring a Consumer Expand section "12.2. Configuring a Consumer" Collapse section "12.2. Configuring a Consumer" 12.2.1. Mechanisms for HTTP Consumer Endpoints 12.2.2. Using Configuration 12.2.3. Using WSDL 12.2.4. Consumer Cache Control Directives 12.3. Configuring a Service Provider Expand section "12.3. Configuring a Service Provider" Collapse section "12.3. Configuring a Service Provider" 12.3.1. Mechanisms for a HTTP Service Provider 12.3.2. Using Configuration 12.3.3. Using WSDL 12.3.4. Service Provider Cache Control Directives 12.4. Configuring the Jetty Runtime 12.5. Configuring the Netty Runtime 12.6. Using the HTTP Transport in Decoupled Mode 13. Using SOAP Over JMS Expand section "13. Using SOAP Over JMS" Collapse section "13. Using SOAP Over JMS" 13.1. Basic configuration 13.2. JMS URIs 13.3. WSDL extensions 14. Using Generic JMS Expand section "14. Using Generic JMS" Collapse section "14. Using Generic JMS" 14.1. Approaches to Configuring JMS 14.2. Using the JMS configuration bean 14.3. Optimizing Client-Side JMS Performance 14.4. Configuring JMS Transactions 14.5. Using WSDL to configure JMS Expand section "14.5. Using WSDL to configure JMS" Collapse section "14.5. Using WSDL to configure JMS" 14.5.1. JMS WSDL Extension Namespance 14.5.2. Basic JMS configuration 14.5.3. JMS client configuration 14.5.4. JMS provider configuration 14.6. Using a Named Reply Destination A. Integrating with Apache ActiveMQ B. Conduits IV. Configuring Web Service Endpoints Expand section "IV. Configuring Web Service Endpoints" Collapse section "IV. Configuring Web Service Endpoints" 15. Configuring JAX-WS Endpoints Expand section "15. Configuring JAX-WS Endpoints" Collapse section "15. Configuring JAX-WS Endpoints" 15.1. Configuring Service Providers Expand section "15.1. Configuring Service Providers" Collapse section "15.1. Configuring Service Providers" 15.1.1. Elements for Configuring Service Providers 15.1.2. Using the jaxws:endpoint Element 15.1.3. Using the jaxws:server Element 15.1.4. Adding Functionality to Service Providers 15.1.5. Enable Schema Validation on a JAX-WS Endpoint 15.2. Configuring Consumer Endpoints 16. Configuring JAX-RS Endpoints Expand section "16. Configuring JAX-RS Endpoints" Collapse section "16. Configuring JAX-RS Endpoints" 16.1. Configuring JAX-RS Server Endpoints Expand section "16.1. Configuring JAX-RS Server Endpoints" Collapse section "16.1. Configuring JAX-RS Server Endpoints" 16.1.1. Defining a JAX-RS Server Endpoint 16.1.2. jaxrs:server Attributes 16.1.3. jaxrs:server Child Elements 16.2. Configuring JAX-RS Client Endpoints Expand section "16.2. Configuring JAX-RS Client Endpoints" Collapse section "16.2. Configuring JAX-RS Client Endpoints" 16.2.1. Defining a JAX-RS Client Endpoint 16.2.2. jaxrs:client Attributes 16.2.3. jaxrs:client Child Elements 16.3. Defining REST Services with the Model Schema 17. Apache CXF Logging Expand section "17. Apache CXF Logging" Collapse section "17. Apache CXF Logging" 17.1. Overview of Apache CXF Logging 17.2. Simple Example of Using Logging 17.3. Default logging configuration file Expand section "17.3. Default logging configuration file" Collapse section "17.3. Default logging configuration file" 17.3.1. Overview of Logging Configuration 17.3.2. Configuring Logging Output 17.3.3. Configuring Logging Levels 17.4. Enabling Logging at the Command Line 17.5. Logging for Subsystems and Services 17.6. Logging Message Content 18. Deploying WS-Addressing Expand section "18. Deploying WS-Addressing" Collapse section "18. Deploying WS-Addressing" 18.1. Introduction to WS-Addressing 18.2. WS-Addressing Interceptors 18.3. Enabling WS-Addressing 18.4. Configuring WS-Addressing Attributes 19. Enabling Reliable Messaging Expand section "19. Enabling Reliable Messaging" Collapse section "19. Enabling Reliable Messaging" 19.1. Introduction to WS-RM 19.2. WS-RM Interceptors 19.3. Enabling WS-RM 19.4. Runtime Control 19.5. Configuring WS-RM Expand section "19.5. Configuring WS-RM" Collapse section "19.5. Configuring WS-RM" 19.5.1. Configuring Apache CXF-Specific WS-RM Attributes 19.5.2. Configuring Standard WS-RM Policy Attributes 19.5.3. WS-RM Configuration Use Cases 19.6. Configuring WS-RM Persistence 20. Enabling High Availability Expand section "20. Enabling High Availability" Collapse section "20. Enabling High Availability" 20.1. Introduction to High Availability 20.2. Enabling HA with Static Failover 20.3. Configuring HA with Static Failover 21. Enabling High Availability in Fuse Fabric Expand section "21. Enabling High Availability in Fuse Fabric" Collapse section "21. Enabling High Availability in Fuse Fabric" 21.1. Load Balancing Cluster Expand section "21.1. Load Balancing Cluster" Collapse section "21.1. Load Balancing Cluster" 21.1.1. Introduction to Load Balancing 21.1.2. Configure the Server 21.1.3. Configure the Client 21.2. Failover Cluster C. Apache CXF Binding IDs D. Using the Maven OSGi Tooling Expand section "D. Using the Maven OSGi Tooling" Collapse section "D. Using the Maven OSGi Tooling" D.1. The Maven Bundle Plug-In D.2. Setting up a Red Hat JBoss Fuse OSGi project D.3. Configuring the Bundle Plug-In V. Developing Applications Using JAX-WS Expand section "V. Developing Applications Using JAX-WS" Collapse section "V. Developing Applications Using JAX-WS" 22. Bottom-Up Service Development Expand section "22. Bottom-Up Service Development" Collapse section "22. Bottom-Up Service Development" 22.1. Introduction to JAX-WS Service Development 22.2. Creating the SEI 22.3. Annotating the Code Expand section "22.3. Annotating the Code" Collapse section "22.3. Annotating the Code" 22.3.1. Overview of JAX-WS Annotations 22.3.2. Required Annotations 22.3.3. Optional Annotations Expand section "22.3.3. Optional Annotations" Collapse section "22.3.3. Optional Annotations" 22.3.3.1. Defining the Binding Properties with Annotations 22.3.3.2. Defining Operation Properties with Annotations 22.3.3.3. Defining Parameter Properties with Annotations 22.3.4. Apache CXF Annotations Expand section "22.3.4. Apache CXF Annotations" Collapse section "22.3.4. Apache CXF Annotations" 22.3.4.1. WSDL Documentation 22.3.4.2. Schema Validation of Messages 22.3.4.3. Specifying the Data Binding 22.3.4.4. Compressing Messages 22.3.4.5. Enable Logging on an Endpoint 22.3.4.6. Adding Properties and Policies to an Endpoint Expand section "22.3.4.6. Adding Properties and Policies to an Endpoint" Collapse section "22.3.4.6. Adding Properties and Policies to an Endpoint" 22.3.4.6.1. Adding properties 22.3.4.6.2. Adding policies 22.4. Generating WSDL 23. Developing a Consumer Without a WSDL Contract Expand section "23. Developing a Consumer Without a WSDL Contract" Collapse section "23. Developing a Consumer Without a WSDL Contract" 23.1. Java-First Consumer Development 23.2. Creating a Service Object 23.3. Adding a Port to a Service 23.4. Getting a Proxy for an Endpoint 23.5. Implementing the Consumer's Business Logic 24. A Starting Point WSDL Contract Expand section "24. A Starting Point WSDL Contract" Collapse section "24. A Starting Point WSDL Contract" 24.1. Sample WSDL Contract 25. Top-Down Service Development Expand section "25. Top-Down Service Development" Collapse section "25. Top-Down Service Development" 25.1. Overview of JAX-WS Service Provider Development 25.2. Generating the Starting Point Code 25.3. Implementing the Service Provider 26. Developing a Consumer From a WSDL Contract Expand section "26. Developing a Consumer From a WSDL Contract" Collapse section "26. Developing a Consumer From a WSDL Contract" 26.1. Generating the Stub Code 26.2. Implementing a Consumer 27. Finding WSDL at Runtime Expand section "27. Finding WSDL at Runtime" Collapse section "27. Finding WSDL at Runtime" 27.1. Mechanisms for Locating the WSDL Document 27.2. Instantiating a Proxy by Injection 27.3. Using a JAX-WS Catalog 27.4. Using a contract resolver 28. Generic Fault Handling Expand section "28. Generic Fault Handling" Collapse section "28. Generic Fault Handling" 28.1. Runtime Faults 28.2. Protocol Faults 29. Publishing a Service Expand section "29. Publishing a Service" Collapse section "29. Publishing a Service" 29.1. When to Publish a Service 29.2. APIs Used to Publish a Service 29.3. Publishing a Service in a Plain Java Application 29.4. Publishing a Service in an OSGi Container 30. Basic Data Binding Concepts Expand section "30. Basic Data Binding Concepts" Collapse section "30. Basic Data Binding Concepts" 30.1. Including and Importing Schema Definitions 30.2. XML Namespace Mapping 30.3. The Object Factory 30.4. Adding Classes to the Runtime Marshaller 31. Using XML Elements 32. Using Simple Types Expand section "32. Using Simple Types" Collapse section "32. Using Simple Types" 32.1. Primitive Types 32.2. Simple Types Defined by Restriction 32.3. Enumerations 32.4. Lists 32.5. Unions 32.6. Simple Type Substitution 33. Using Complex Types Expand section "33. Using Complex Types" Collapse section "33. Using Complex Types" 33.1. Basic Complex Type Mapping 33.2. Attributes 33.3. Deriving Complex Types from Simple Types 33.4. Deriving Complex Types from Complex Types 33.5. Occurrence Constraints Expand section "33.5. Occurrence Constraints" Collapse section "33.5. Occurrence Constraints" 33.5.1. Schema Elements Supporting Occurrence Constraints 33.5.2. Occurrence Constraints on the All Element 33.5.3. Occurrence Constraints on the Choice Element 33.5.4. Occurrence Constraints on Elements 33.5.5. Occurrence Constraints on Sequences 33.6. Using Model Groups 34. Using Wild Card Types Expand section "34. Using Wild Card Types" Collapse section "34. Using Wild Card Types" 34.1. Using Any Elements 34.2. Using the XML Schema anyType Type 34.3. Using Unbound Attributes 35. Element Substitution Expand section "35. Element Substitution" Collapse section "35. Element Substitution" 35.1. Substitution Groups in XML Schema 35.2. Substitution Groups in Java 35.3. Widget Vendor Example Expand section "35.3. Widget Vendor Example" Collapse section "35.3. Widget Vendor Example" 35.3.1. Widget Ordering Interface 35.3.2. The checkWidgets Operation 35.3.3. The placeWidgetOrder Operation 36. Customizing How Types are Generated Expand section "36. Customizing How Types are Generated" Collapse section "36. Customizing How Types are Generated" 36.1. Basics of Customizing Type Mappings 36.2. Specifying the Java Class of an XML Schema Primitive 36.3. Generating Java Classes for Simple Types 36.4. Customizing Enumeration Mapping 36.5. Customizing Fixed Value Attribute Mapping 36.6. Specifying the Base Type of an Element or an Attribute 37. Using A JAXBContext Object 38. Developing Asynchronous Applications Expand section "38. Developing Asynchronous Applications" Collapse section "38. Developing Asynchronous Applications" 38.1. Types of Asynchronous Invocation 38.2. WSDL for Asynchronous Examples 38.3. Generating the Stub Code 38.4. Implementing an Asynchronous Client with the Polling Approach 38.5. Implementing an Asynchronous Client with the Callback Approach 38.6. Catching Exceptions Returned from a Remote Service 39. Using Raw XML Messages Expand section "39. Using Raw XML Messages" Collapse section "39. Using Raw XML Messages" 39.1. Using XML in a Consumer Expand section "39.1. Using XML in a Consumer" Collapse section "39.1. Using XML in a Consumer" 39.1.1. Usage Modes 39.1.2. Data Types 39.1.3. Working with Dispatch Objects 39.2. Using XML in a Service Provider Expand section "39.2. Using XML in a Service Provider" Collapse section "39.2. Using XML in a Service Provider" 39.2.1. Messaging Modes 39.2.2. Data Types 39.2.3. Implementing a Provider Object 40. Working with Contexts Expand section "40. Working with Contexts" Collapse section "40. Working with Contexts" 40.1. Understanding Contexts 40.2. Working with Contexts in a Service Implementation 40.3. Working with Contexts in a Consumer Implementation 40.4. Working with JMS Message Properties Expand section "40.4. Working with JMS Message Properties" Collapse section "40.4. Working with JMS Message Properties" 40.4.1. Inspecting JMS Message Headers 40.4.2. Inspecting the Message Header Properties 40.4.3. Setting JMS Properties 41. Writing Handlers Expand section "41. Writing Handlers" Collapse section "41. Writing Handlers" 41.1. Handlers: An Introduction 41.2. Implementing a Logical Handler 41.3. Handling Messages in a Logical Handler 41.4. Implementing a Protocol Handler 41.5. Handling Messages in a SOAP Handler 41.6. Initializing a Handler 41.7. Handling Fault Messages 41.8. Closing a Handler 41.9. Releasing a Handler 41.10. Configuring Endpoints to Use Handlers Expand section "41.10. Configuring Endpoints to Use Handlers" Collapse section "41.10. Configuring Endpoints to Use Handlers" 41.10.1. Programmatic Configuration Expand section "41.10.1. Programmatic Configuration" Collapse section "41.10.1. Programmatic Configuration" 41.10.1.1. Adding a Handler Chain to a Consumer 41.10.1.2. Adding a Handler Chain to a Service Provider 41.10.2. Spring Configuration E. Maven Tooling Reference Expand section "E. Maven Tooling Reference" Collapse section "E. Maven Tooling Reference" E.1. Plug-in Setup E.2. cxf-codegen-plugin E.3. java2ws VI. Developing RESTful Web Services Expand section "VI. Developing RESTful Web Services" Collapse section "VI. Developing RESTful Web Services" 42. Introduction to RESTful Web Services 43. Creating Resources Expand section "43. Creating Resources" Collapse section "43. Creating Resources" 43.1. Introduction 43.2. Basic JAX-RS annotations 43.3. Root resource classes 43.4. Working with resource methods 43.5. Working with sub-resources 43.6. Resource selection method 44. Passing Information into Resource Classes and Methods Expand section "44. Passing Information into Resource Classes and Methods" Collapse section "44. Passing Information into Resource Classes and Methods" 44.1. Basics of injecting data 44.2. Using JAX-RS APIs Expand section "44.2. Using JAX-RS APIs" Collapse section "44.2. Using JAX-RS APIs" 44.2.1. JAX-RS Annotation Types 44.2.2. Injecting data from a request URI 44.2.3. Injecting data from the HTTP message header 44.2.4. Injecting data from HTML forms 44.2.5. Specifying a default value to inject 44.2.6. Injecting Parameters into a Java Bean 44.3. Parameter Converters 44.4. Using Apache CXF extensions 45. Returning Information to the Consumer Expand section "45. Returning Information to the Consumer" Collapse section "45. Returning Information to the Consumer" 45.1. Return Types 45.2. Returning plain Java constructs 45.3. Fine tuning an application's responses Expand section "45.3. Fine tuning an application's responses" Collapse section "45.3. Fine tuning an application's responses" 45.3.1. Basics of building responses 45.3.2. Creating responses for common use cases 45.3.3. Handling more advanced responses 45.4. Returning entities with generic type information 45.5. Asynchronous Response Expand section "45.5. Asynchronous Response" Collapse section "45.5. Asynchronous Response" 45.5.1. Asynchronous Processing on the Server 45.5.2. Timeouts and Timeout Handlers 45.5.3. Handling Dropped Connections 45.5.4. Registering Callbacks 46. JAX-RS 2.0 Client API Expand section "46. JAX-RS 2.0 Client API" Collapse section "46. JAX-RS 2.0 Client API" 46.1. Introduction to the JAX-RS 2.0 Client API 46.2. Building the Client Target 46.3. Building the Client Invocation 46.4. Parsing Requests and Responses 46.5. Configuring the Client Endpoint 46.6. Asynchronous Processing on the Client 47. Handling Exceptions Expand section "47. Handling Exceptions" Collapse section "47. Handling Exceptions" 47.1. Overview of JAX-RS Exception Classes 47.2. Using WebApplicationException exceptions to report errors 47.3. JAX-RS 2.0 Exception Types 47.4. Mapping Exceptions to Responses 48. Entity Support 49. Getting and Using Context Information Expand section "49. Getting and Using Context Information" Collapse section "49. Getting and Using Context Information" 49.1. Introduction to contexts 49.2. Working with the full request URI Expand section "49.2. Working with the full request URI" Collapse section "49.2. Working with the full request URI" 49.2.1. Injecting the URI information 49.2.2. Working with the URI 49.2.3. Getting the value of URI template variables 50. Annotation Inheritance 51. Extending JAX-RS Endpoints with Swagger Support Expand section "51. Extending JAX-RS Endpoints with Swagger Support" Collapse section "51. Extending JAX-RS Endpoints with Swagger Support" 51.1. Standalone CXF Implementations 51.2. JBoss Fuse CXF Implementations VII. Developing Apache CXF Interceptors Expand section "VII. Developing Apache CXF Interceptors" Collapse section "VII. Developing Apache CXF Interceptors" 52. Interceptors in the Apache CXF Runtime 53. The Interceptor APIs 54. Determining When the Interceptor is Invoked Expand section "54. Determining When the Interceptor is Invoked" Collapse section "54. Determining When the Interceptor is Invoked" 54.1. Specifying the Interceptor Location 54.2. Specifying an interceptor's phase 54.3. Constraining an interceptors placement in a phase 55. Implementing the Interceptors Processing Logic Expand section "55. Implementing the Interceptors Processing Logic" Collapse section "55. Implementing the Interceptors Processing Logic" 55.1. Interceptor Flow 55.2. Processing messages 55.3. Unwinding after an error 56. Configuring Endpoints to Use Interceptors Expand section "56. Configuring Endpoints to Use Interceptors" Collapse section "56. Configuring Endpoints to Use Interceptors" 56.1. Deciding where to attach interceptors 56.2. Adding interceptors using configuration 56.3. Adding interceptors programmatically Expand section "56.3. Adding interceptors programmatically" Collapse section "56.3. Adding interceptors programmatically" 56.3.1. Approaches to Adding Interceptors 56.3.2. Using the interceptor provider API 56.3.3. Using Java annotations 57. Manipulating Interceptor Chains on the Fly 58. JAX-RS 2.0 Filters and Interceptors Expand section "58. JAX-RS 2.0 Filters and Interceptors" Collapse section "58. JAX-RS 2.0 Filters and Interceptors" 58.1. Introduction to JAX-RS Filters and Interceptors 58.2. Container Request Filter 58.3. Container Response Filter 58.4. Client Request Filter 58.5. Client Response Filter 58.6. Entity Reader Interceptor 58.7. Entity Writer Interceptor 58.8. Dynamic Binding F. Apache CXF Message Processing Phases G. Apache CXF Provided Interceptors Expand section "G. Apache CXF Provided Interceptors" Collapse section "G. Apache CXF Provided Interceptors" G.1. Core Apache CXF Interceptors G.2. Front-Ends G.3. Message bindings G.4. Other features H. Interceptor Providers VIII. Apache CXF Features Expand section "VIII. Apache CXF Features" Collapse section "VIII. Apache CXF Features" 59. Bean Validation Expand section "59. Bean Validation" Collapse section "59. Bean Validation" 59.1. Introduction 59.2. Developing Services with Bean Validation Expand section "59.2. Developing Services with Bean Validation" Collapse section "59.2. Developing Services with Bean Validation" 59.2.1. Annotating a Service Bean 59.2.2. Standard Annotations 59.2.3. Custom Annotations 59.3. Configuring Bean Validation Expand section "59.3. Configuring Bean Validation" Collapse section "59.3. Configuring Bean Validation" 59.3.1. JAX-WS Configuration 59.3.2. JAX-RS Configuration 59.3.3. JAX-RS 2.0 Configuration Index Trademark Disclaimer Document options Language: English Format: Single-page HTML PDF ePub Red Hat Training A Red Hat training course is available for Red Hat Fuse Part VIII. Apache CXF Features Abstract This guide describes how to enable various advanced features of Apache CXF. Previous Next