Jump To Close Expand all Collapse all Table of contents 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.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 22. Packaging an Application 23. Deploying an Application 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" 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 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 43.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" 44. Introduction to RESTful Web Services 45. Creating Resources Expand section "45. Creating Resources" Collapse section "45. Creating Resources" 45.1. Introduction 45.2. Basic JAX-RS annotations 45.3. Root resource classes 45.4. Working with resource methods 45.5. Working with sub-resources 45.6. Resource selection method 46. Passing Information into Resource Classes and Methods Expand section "46. Passing Information into Resource Classes and Methods" Collapse section "46. Passing Information into Resource Classes and Methods" 46.1. Basics of injecting data 46.2. Using JAX-RS APIs Expand section "46.2. Using JAX-RS APIs" Collapse section "46.2. Using JAX-RS APIs" 46.2.1. JAX-RS Annotation Types 46.2.2. Injecting data from a request URI 46.2.3. Injecting data from the HTTP message header 46.2.4. Injecting data from HTML forms 46.2.5. Specifying a default value to inject 46.2.6. Injecting Parameters into a Java Bean 46.3. Parameter Converters 46.4. Using Apache CXF extensions 47. Returning Information to the Consumer Expand section "47. Returning Information to the Consumer" Collapse section "47. Returning Information to the Consumer" 47.1. Return Types 47.2. Returning plain Java constructs 47.3. Fine tuning an application's responses Expand section "47.3. Fine tuning an application's responses" Collapse section "47.3. Fine tuning an application's responses" 47.3.1. Basics of building responses 47.3.2. Creating responses for common use cases 47.3.3. Handling more advanced responses 47.4. Returning entities with generic type information 47.5. Asynchronous Response Expand section "47.5. Asynchronous Response" Collapse section "47.5. Asynchronous Response" 47.5.1. Asynchronous Processing on the Server 47.5.2. Timeouts and Timeout Handlers 47.5.3. Handling Dropped Connections 47.5.4. Registering Callbacks 48. JAX-RS 2.0 Client API Expand section "48. JAX-RS 2.0 Client API" Collapse section "48. JAX-RS 2.0 Client API" 48.1. Introduction to the JAX-RS 2.0 Client API 48.2. Building the Client Target 48.3. Building the Client Invocation 48.4. Parsing Requests and Responses 48.5. Configuring the Client Endpoint 48.6. Asynchronous Processing on the Client 49. Handling Exceptions Expand section "49. Handling Exceptions" Collapse section "49. Handling Exceptions" 49.1. Overview of JAX-RS Exception Classes 49.2. Using WebApplicationException exceptions to report errors 49.3. JAX-RS 2.0 Exception Types 49.4. Mapping Exceptions to Responses 50. Entity Support 51. Getting and Using Context Information Expand section "51. Getting and Using Context Information" Collapse section "51. Getting and Using Context Information" 51.1. Introduction to contexts 51.2. Working with the full request URI Expand section "51.2. Working with the full request URI" Collapse section "51.2. Working with the full request URI" 51.2.1. Injecting the URI information 51.2.2. Working with the URI 51.2.3. Getting the value of URI template variables 52. Annotation Inheritance 53. Extending JAX-RS Endpoints with Swagger Support Expand section "53. Extending JAX-RS Endpoints with Swagger Support" Collapse section "53. Extending JAX-RS Endpoints with Swagger Support" 53.1. Standalone CXF Implementations 53.2. JBoss Fuse CXF Implementations VII. Developing Apache CXF Interceptors Expand section "VII. Developing Apache CXF Interceptors" Collapse section "VII. Developing Apache CXF Interceptors" 54. Interceptors in the Apache CXF Runtime 55. The Interceptor APIs 56. Determining When the Interceptor is Invoked Expand section "56. Determining When the Interceptor is Invoked" Collapse section "56. Determining When the Interceptor is Invoked" 56.1. Specifying the Interceptor Location 56.2. Specifying an interceptor's phase 56.3. Constraining an interceptors placement in a phase 57. Implementing the Interceptors Processing Logic Expand section "57. Implementing the Interceptors Processing Logic" Collapse section "57. Implementing the Interceptors Processing Logic" 57.1. Interceptor Flow 57.2. Processing messages 57.3. Unwinding after an error 58. Configuring Endpoints to Use Interceptors Expand section "58. Configuring Endpoints to Use Interceptors" Collapse section "58. Configuring Endpoints to Use Interceptors" 58.1. Deciding where to attach interceptors 58.2. Adding interceptors using configuration 58.3. Adding interceptors programmatically Expand section "58.3. Adding interceptors programmatically" Collapse section "58.3. Adding interceptors programmatically" 58.3.1. Approaches to Adding Interceptors 58.3.2. Using the interceptor provider API 58.3.3. Using Java annotations 59. Manipulating Interceptor Chains on the Fly 60. JAX-RS 2.0 Filters and Interceptors Expand section "60. JAX-RS 2.0 Filters and Interceptors" Collapse section "60. JAX-RS 2.0 Filters and Interceptors" 60.1. Introduction to JAX-RS Filters and Interceptors 60.2. Container Request Filter 60.3. Container Response Filter 60.4. Client Request Filter 60.5. Client Response Filter 60.6. Entity Reader Interceptor 60.7. Entity Writer Interceptor 60.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" 61. Bean Validation Expand section "61. Bean Validation" Collapse section "61. Bean Validation" 61.1. Introduction 61.2. Developing Services with Bean Validation Expand section "61.2. Developing Services with Bean Validation" Collapse section "61.2. Developing Services with Bean Validation" 61.2.1. Annotating a Service Bean 61.2.2. Standard Annotations 61.2.3. Custom Annotations 61.3. Configuring Bean Validation Expand section "61.3. Configuring Bean Validation" Collapse section "61.3. Configuring Bean Validation" 61.3.1. JAX-WS Configuration 61.3.2. JAX-RS Configuration 61.3.3. JAX-RS 2.0 Configuration Index Trademark Disclaimer Settings Close Language: English Format: Multi-page Single-page PDF Format: Multi-page Single-page PDF Language and Page Formatting Options Language: English Format: Multi-page Single-page PDF Format: Multi-page Single-page PDF Red Hat Training A Red Hat training course is available for Red Hat Fuse Part I. Writing WSDL Contracts Abstract This part describes how to define a Web service interface using WSDL. Previous Next