Jump To Close Expand all Collapse all Table of contents Apache CXF Development Guide Making open source more inclusive 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 Undertow 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 15. Integrating with Apache ActiveMQ 16. Conduits IV. Configuring Web Service Endpoints Expand section "IV. Configuring Web Service Endpoints" Collapse section "IV. Configuring Web Service Endpoints" 17. Configuring JAX-WS Endpoints Expand section "17. Configuring JAX-WS Endpoints" Collapse section "17. Configuring JAX-WS Endpoints" 17.1. Configuring Service Providers Expand section "17.1. Configuring Service Providers" Collapse section "17.1. Configuring Service Providers" 17.1.1. Elements for Configuring Service Providers 17.1.2. Using the jaxws:endpoint Element 17.1.3. Using the jaxws:server Element 17.1.4. Adding Functionality to Service Providers 17.1.5. Enable Schema Validation on a JAX-WS Endpoint 17.2. Configuring Consumer Endpoints 18. Configuring JAX-RS Endpoints Expand section "18. Configuring JAX-RS Endpoints" Collapse section "18. Configuring JAX-RS Endpoints" 18.1. Configuring JAX-RS Server Endpoints Expand section "18.1. Configuring JAX-RS Server Endpoints" Collapse section "18.1. Configuring JAX-RS Server Endpoints" 18.1.1. Defining a JAX-RS Server Endpoint 18.1.2. jaxrs:server Attributes 18.1.3. jaxrs:server Child Elements 18.2. Configuring JAX-RS Client Endpoints Expand section "18.2. Configuring JAX-RS Client Endpoints" Collapse section "18.2. Configuring JAX-RS Client Endpoints" 18.2.1. Defining a JAX-RS Client Endpoint 18.2.2. jaxrs:client Attributes 18.2.3. jaxrs:client Child Elements 18.3. Defining REST Services with the Model Schema 19. Apache CXF Logging Expand section "19. Apache CXF Logging" Collapse section "19. Apache CXF Logging" 19.1. Overview of Apache CXF Logging 19.2. Simple Example of Using Logging 19.3. Default logging configuration file Expand section "19.3. Default logging configuration file" Collapse section "19.3. Default logging configuration file" 19.3.1. Overview of Logging Configuration 19.3.2. Configuring Logging Output 19.3.3. Configuring Logging Levels 19.4. Enabling Logging at the Command Line 19.5. Logging for Subsystems and Services 19.6. Logging Message Content 20. Deploying WS-Addressing Expand section "20. Deploying WS-Addressing" Collapse section "20. Deploying WS-Addressing" 20.1. Introduction to WS-Addressing 20.2. WS-Addressing Interceptors 20.3. Enabling WS-Addressing 20.4. Configuring WS-Addressing Attributes 21. Enabling Reliable Messaging Expand section "21. Enabling Reliable Messaging" Collapse section "21. Enabling Reliable Messaging" 21.1. Introduction to WS-RM 21.2. WS-RM Interceptors 21.3. Enabling WS-RM 21.4. Runtime Control 21.5. Configuring WS-RM Expand section "21.5. Configuring WS-RM" Collapse section "21.5. Configuring WS-RM" 21.5.1. Configuring Apache CXF-Specific WS-RM Attributes 21.5.2. Configuring Standard WS-RM Policy Attributes 21.5.3. WS-RM Configuration Use Cases 21.6. Configuring WS-RM Persistence 22. Enabling High Availability Expand section "22. Enabling High Availability" Collapse section "22. Enabling High Availability" 22.1. Introduction to High Availability 22.2. Enabling HA with Static Failover 22.3. Configuring HA with Static Failover 23. Apache CXF Binding IDs A. Using the Maven OSGi Tooling Expand section "A. Using the Maven OSGi Tooling" Collapse section "A. Using the Maven OSGi Tooling" A.1. The Maven Bundle Plug-In A.2. Setting up a Red Hat Fuse OSGi project A.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" 24. Bottom-Up Service Development Expand section "24. Bottom-Up Service Development" Collapse section "24. Bottom-Up Service Development" 24.1. Introduction to JAX-WS Service Development 24.2. Creating the SEI 24.3. Annotating the Code Expand section "24.3. Annotating the Code" Collapse section "24.3. Annotating the Code" 24.3.1. Overview of JAX-WS Annotations 24.3.2. Required Annotations 24.3.3. Optional Annotations 24.3.4. Apache CXF Annotations Expand section "24.3.4. Apache CXF Annotations" Collapse section "24.3.4. Apache CXF Annotations" 24.3.4.1. WSDL Documentation 24.3.4.2. @WSDLDocumentation properties 24.3.4.3. Using @WSDLDocumentation 24.3.4.4. WSDL generated with documentation 24.3.4.5. Using @WSDLDocumentationCollection 24.3.4.6. Schema Validation of Messages 24.3.4.7. Schema Validation Type Values 24.3.4.8. Specifying the Data Binding 24.3.4.9. Setting the data binding 24.3.4.10. Compressing Messages 24.3.4.11. @GZIP Properties 24.3.4.12. @FastInfoset Properties 24.3.4.13. Enabling GZIP 24.3.4.14. Enabling FastInfoset 24.3.4.15. Enable Logging on an Endpoint 24.3.4.16. @Logging Properties 24.3.4.17. Logging configuration using annotations 24.3.4.18. Adding Properties and Policies to an Endpoint 24.3.4.19. Adding properties 24.3.4.20. Configuring WS-Security Using @EndpointProperty Annotations 24.3.4.21. Configuring WS-Security Using an @EndpointProperties Annotation 24.3.4.22. Adding policies 24.3.4.23. @Policy Properties 24.4. Generating WSDL 25. Developing a Consumer Without a WSDL Contract Expand section "25. Developing a Consumer Without a WSDL Contract" Collapse section "25. Developing a Consumer Without a WSDL Contract" 25.1. Java-First Consumer Development 25.2. Creating a Service Object 25.3. Adding a Port to a Service 25.4. Getting a Proxy for an Endpoint 25.5. Implementing the Consumer’s Business Logic 26. A Starting Point WSDL Contract Expand section "26. A Starting Point WSDL Contract" Collapse section "26. A Starting Point WSDL Contract" 26.1. Sample WSDL Contract 27. Top-Down Service Development Expand section "27. Top-Down Service Development" Collapse section "27. Top-Down Service Development" 27.1. Overview of JAX-WS Service Provider Development 27.2. Generating the Starting Point Code 27.3. Implementing the Service Provider 28. Developing a Consumer From a WSDL Contract Expand section "28. Developing a Consumer From a WSDL Contract" Collapse section "28. Developing a Consumer From a WSDL Contract" 28.1. Generating the Stub Code 28.2. Implementing a Consumer 29. Finding WSDL at Runtime Expand section "29. Finding WSDL at Runtime" Collapse section "29. Finding WSDL at Runtime" 29.1. Mechanisms for Locating the WSDL Document 29.2. Instantiating a Proxy by Injection 29.3. Using a JAX-WS Catalog 29.4. Using a contract resolver 30. Generic Fault Handling Expand section "30. Generic Fault Handling" Collapse section "30. Generic Fault Handling" 30.1. Runtime Faults 30.2. Protocol Faults 31. Publishing a Service Expand section "31. Publishing a Service" Collapse section "31. Publishing a Service" 31.1. When to Publish a Service 31.2. APIs Used to Publish a Service 31.3. Publishing a Service in a Plain Java Application 31.4. Publishing a Service in an OSGi Container 32. Basic Data Binding Concepts Expand section "32. Basic Data Binding Concepts" Collapse section "32. Basic Data Binding Concepts" 32.1. Including and Importing Schema Definitions 32.2. XML Namespace Mapping 32.3. The Object Factory 32.4. Adding Classes to the Runtime Marshaller 33. Using XML Elements 34. Using Simple Types Expand section "34. Using Simple Types" Collapse section "34. Using Simple Types" 34.1. Primitive Types 34.2. Simple Types Defined by Restriction 34.3. Enumerations 34.4. Lists 34.5. Unions 34.6. Simple Type Substitution 35. Using Complex Types Expand section "35. Using Complex Types" Collapse section "35. Using Complex Types" 35.1. Basic Complex Type Mapping 35.2. Attributes 35.3. Deriving Complex Types from Simple Types 35.4. Deriving Complex Types from Complex Types 35.5. Occurrence Constraints Expand section "35.5. Occurrence Constraints" Collapse section "35.5. Occurrence Constraints" 35.5.1. Schema Elements Supporting Occurrence Constraints 35.5.2. Occurrence Constraints on the All Element 35.5.3. Occurrence Constraints on the Choice Element 35.5.4. Occurrence Constraints on Elements 35.5.5. Occurrence Constraints on Sequences 35.6. Using Model Groups 36. Using Wild Card Types Expand section "36. Using Wild Card Types" Collapse section "36. Using Wild Card Types" 36.1. Using Any Elements 36.2. Using the XML Schema anyType Type 36.3. Using Unbound Attributes 37. Element Substitution Expand section "37. Element Substitution" Collapse section "37. Element Substitution" 37.1. Substitution Groups in XML Schema 37.2. Substitution Groups in Java 37.3. Widget Vendor Example Expand section "37.3. Widget Vendor Example" Collapse section "37.3. Widget Vendor Example" 37.3.1. Widget Ordering Interface 37.3.2. The checkWidgets Operation 37.3.3. The placeWidgetOrder Operation 38. Customizing How Types are Generated Expand section "38. Customizing How Types are Generated" Collapse section "38. Customizing How Types are Generated" 38.1. Basics of Customizing Type Mappings 38.2. Specifying the Java Class of an XML Schema Primitive 38.3. Generating Java Classes for Simple Types 38.4. Customizing Enumeration Mapping 38.5. Customizing Fixed Value Attribute Mapping 38.6. Specifying the Base Type of an Element or an Attribute 39. Using A JAXBContext Object 40. Developing Asynchronous Applications Expand section "40. Developing Asynchronous Applications" Collapse section "40. Developing Asynchronous Applications" 40.1. Types of Asynchronous Invocation 40.2. WSDL for Asynchronous Examples 40.3. Generating the Stub Code 40.4. Implementing an Asynchronous Client with the Polling Approach 40.5. Implementing an Asynchronous Client with the Callback Approach 40.6. Catching Exceptions Returned from a Remote Service 41. Using Raw XML Messages Expand section "41. Using Raw XML Messages" Collapse section "41. Using Raw XML Messages" 41.1. Using XML in a Consumer Expand section "41.1. Using XML in a Consumer" Collapse section "41.1. Using XML in a Consumer" 41.1.1. Usage Modes 41.1.2. Data Types 41.1.3. Working with Dispatch Objects 41.2. Using XML in a Service Provider Expand section "41.2. Using XML in a Service Provider" Collapse section "41.2. Using XML in a Service Provider" 41.2.1. Messaging Modes 41.2.2. Data Types 41.2.3. Implementing a Provider Object 42. Working with Contexts Expand section "42. Working with Contexts" Collapse section "42. Working with Contexts" 42.1. Understanding Contexts 42.2. Working with Contexts in a Service Implementation 42.3. Working with Contexts in a Consumer Implementation 42.4. Working with JMS Message Properties Expand section "42.4. Working with JMS Message Properties" Collapse section "42.4. Working with JMS Message Properties" 42.4.1. Inspecting JMS Message Headers 42.4.2. Inspecting the Message Header Properties 42.4.3. Setting JMS Properties 43. Writing Handlers Expand section "43. Writing Handlers" Collapse section "43. Writing Handlers" 43.1. Handlers: An Introduction 43.2. Implementing a Logical Handler 43.3. Handling Messages in a Logical Handler 43.4. Implementing a Protocol Handler 43.5. Handling Messages in a SOAP Handler 43.6. Initializing a Handler 43.7. Handling Fault Messages 43.8. Closing a Handler 43.9. Releasing a Handler 43.10. Configuring Endpoints to Use Handlers Expand section "43.10. Configuring Endpoints to Use Handlers" Collapse section "43.10. Configuring Endpoints to Use Handlers" 43.10.1. Programmatic Configuration Expand section "43.10.1. Programmatic Configuration" Collapse section "43.10.1. Programmatic Configuration" 43.10.1.1. Adding a Handler Chain to a Consumer 43.10.1.2. Adding a Handler Chain to a Service Provider 43.10.2. Spring Configuration 44. Maven Tooling Reference Expand section "44. Maven Tooling Reference" Collapse section "44. Maven Tooling Reference" 44.1. Plug-in Setup 44.2. cxf-codegen-plugin 44.3. java2ws VI. Developing RESTful Web Services Expand section "VI. Developing RESTful Web Services" Collapse section "VI. Developing RESTful Web Services" 45. Introduction to RESTful Web Services 46. Creating Resources Expand section "46. Creating Resources" Collapse section "46. Creating Resources" 46.1. Introduction 46.2. Basic JAX-RS annotations 46.3. Root resource classes 46.4. Working with resource methods 46.5. Working with sub-resources 46.6. Resource selection method 47. Passing Information into Resource Classes and Methods Expand section "47. Passing Information into Resource Classes and Methods" Collapse section "47. Passing Information into Resource Classes and Methods" 47.1. Basics of injecting data 47.2. Using JAX-RS APIs Expand section "47.2. Using JAX-RS APIs" Collapse section "47.2. Using JAX-RS APIs" 47.2.1. JAX-RS Annotation Types 47.2.2. Injecting data from a request URI 47.2.3. Injecting data from the HTTP message header 47.2.4. Injecting data from HTML forms 47.2.5. Specifying a default value to inject 47.2.6. Injecting Parameters into a Java Bean 47.3. Parameter Converters 47.4. Using Apache CXF extensions 48. Returning Information to the Consumer Expand section "48. Returning Information to the Consumer" Collapse section "48. Returning Information to the Consumer" 48.1. Return Types 48.2. Returning plain Java constructs 48.3. Fine tuning an application’s responses Expand section "48.3. Fine tuning an application’s responses" Collapse section "48.3. Fine tuning an application’s responses" 48.3.1. Basics of building responses 48.3.2. Creating responses for common use cases 48.3.3. Handling more advanced responses 48.4. Returning entities with generic type information 48.5. Asynchronous Response Expand section "48.5. Asynchronous Response" Collapse section "48.5. Asynchronous Response" 48.5.1. Asynchronous Processing on the Server 48.5.2. Timeouts and Timeout Handlers 48.5.3. Handling Dropped Connections 48.5.4. Registering Callbacks 49. JAX-RS 2.0 Client API Expand section "49. JAX-RS 2.0 Client API" Collapse section "49. JAX-RS 2.0 Client API" 49.1. Introduction to the JAX-RS 2.0 Client API 49.2. Building the Client Target 49.3. Building the Client Invocation 49.4. Parsing Requests and Responses 49.5. Configuring the Client Endpoint 49.6. Asynchronous Processing on the Client 50. Handling Exceptions Expand section "50. Handling Exceptions" Collapse section "50. Handling Exceptions" 50.1. Overview of JAX-RS Exception Classes 50.2. Using WebApplicationException exceptions to report 50.3. JAX-RS 2.0 Exception Types 50.4. Mapping Exceptions to Responses 51. Entity Support 52. Getting and Using Context Information Expand section "52. Getting and Using Context Information" Collapse section "52. Getting and Using Context Information" 52.1. Introduction to contexts 52.2. Working with the full request URI Expand section "52.2. Working with the full request URI" Collapse section "52.2. Working with the full request URI" 52.2.1. Injecting the URI information 52.2.2. Working with the URI 52.2.3. Getting the value of URI template variables 53. Annotation Inheritance 54. Extending JAX-RS Endpoints with OpenAPI Support Expand section "54. Extending JAX-RS Endpoints with OpenAPI Support" Collapse section "54. Extending JAX-RS Endpoints with OpenAPI Support" 54.1. OpenApiFeature options 54.2. Karaf Implementations Expand section "54.2. Karaf Implementations" Collapse section "54.2. Karaf Implementations" 54.2.1. Quickstart example 54.2.2. Enabling OpenAPI 54.3. Spring Boot Implementations Expand section "54.3. Spring Boot Implementations" Collapse section "54.3. Spring Boot Implementations" 54.3.1. Quickstart example 54.3.2. Enabling Swagger 54.4. Accessing OpenAPI Documents 54.5. Accessing OpenAPI through a reverse proxy VII. Developing Apache CXF Interceptors Expand section "VII. Developing Apache CXF Interceptors" Collapse section "VII. Developing Apache CXF Interceptors" 55. Interceptors in the Apache CXF Runtime 56. The Interceptor APIs 57. Determining When the Interceptor is Invoked Expand section "57. Determining When the Interceptor is Invoked" Collapse section "57. Determining When the Interceptor is Invoked" 57.1. Specifying the Interceptor Location 57.2. Specifying an interceptor’s phase 57.3. Constraining an interceptors placement in a phase 58. Implementing the Interceptors Processing Logic Expand section "58. Implementing the Interceptors Processing Logic" Collapse section "58. Implementing the Interceptors Processing Logic" 58.1. Interceptor Flow 58.2. Processing messages 58.3. Unwinding after an error 59. Configuring Endpoints to Use Interceptors Expand section "59. Configuring Endpoints to Use Interceptors" Collapse section "59. Configuring Endpoints to Use Interceptors" 59.1. Deciding where to attach interceptors 59.2. Adding interceptors using configuration 59.3. Adding interceptors programmatically Expand section "59.3. Adding interceptors programmatically" Collapse section "59.3. Adding interceptors programmatically" 59.3.1. Approaches to Adding Interceptors 59.3.2. Using the interceptor provider API 59.3.3. Using Java annotations 60. Manipulating Interceptor Chains on the Fly 61. JAX-RS 2.0 Filters and Interceptors Expand section "61. JAX-RS 2.0 Filters and Interceptors" Collapse section "61. JAX-RS 2.0 Filters and Interceptors" 61.1. Introduction to JAX-RS Filters and Interceptors 61.2. Container Request Filter 61.3. Container Response Filter 61.4. Client Request Filter 61.5. Client Response Filter 61.6. Entity Reader Interceptor 61.7. Entity Writer Interceptor 61.8. Dynamic Binding 62. Apache CXF Message Processing Phases 63. Apache CXF Provided Interceptors Expand section "63. Apache CXF Provided Interceptors" Collapse section "63. Apache CXF Provided Interceptors" 63.1. Core Apache CXF Interceptors 63.2. Front-Ends 63.3. Message bindings 63.4. Other features 64. Interceptor Providers VIII. Apache CXF Features Expand section "VIII. Apache CXF Features" Collapse section "VIII. Apache CXF Features" 65. Bean Validation Expand section "65. Bean Validation" Collapse section "65. Bean Validation" 65.1. Introduction 65.2. Developing Services with Bean Validation Expand section "65.2. Developing Services with Bean Validation" Collapse section "65.2. Developing Services with Bean Validation" 65.2.1. Annotating a Service Bean 65.2.2. Standard Annotations 65.2.3. Custom Annotations 65.3. Configuring Bean Validation Expand section "65.3. Configuring Bean Validation" Collapse section "65.3. Configuring Bean Validation" 65.3.1. JAX-WS Configuration 65.3.2. JAX-RS Configuration 65.3.3. JAX-RS 2.0 Configuration Legal Notice Settings Close Language: 简体中文 한국어 日本語 English Language: 简体中文 한국어 日本語 English Format: Multi-page Single-page PDF Format: Multi-page Single-page PDF Language and Page Formatting Options Language: 简体中文 한국어 日本語 English Language: 简体中文 한국어 日本語 English Format: Multi-page Single-page PDF Format: Multi-page Single-page PDF Part II. Web Services Bindings This part describes how to add Apache CXF bindings to a WSDL document. Previous Next