Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CXF seeks to build the necessary infrastructure components for services. Goals for CXF are many and include:

  • Embeddable
  • High performanceEmbeddable
  • Intuitive and easy to use
  • Clean separation of front-ends from the core code.
  • Data formats support
  • Pluggable data bindings
  • Protocol bindings support including SOAP, REST, pure XML and CORBA.
  • Data formats support including XML Textual, JSON, FastInfoset
  • Multiple transports support
  • Multiple Programming Languages SupportMultiple transports support
  • WS-* and related specification support including WS-Addressing, WS-Policy, WS-ReliableMessaging, WS-Security, WS-SecurityPolicy, WS-SecureConverstation and WS-Trust (partial).
  • Flexible deployment
  • Multiple Programming Languages Support
  • Tools for code generation and WSDL validation
  • Flexible deployment

The overall CXF architecture is primarily made up of the following parts:

  1. Bus: This is the backbone of the Apache CXF architecture.
  2. Front-ends: Front-ends provide a programming model to create services.
  3. Messaging & Interceptors: These provide the low level message and pipeline layer upon which most functionality is built.
  4. Services: Services host a Service model which is a WSDL-like model that describes the service.
  5. Pluggable Data Bindings: ...
  6. Protocol Bindings: Bindings provide the functionality to interpret the protocol (e.g., SOAP, REST, CORBA).
  7. Transports: Destinations and Conduits make up the transport abstraction that CXF uses to achieve transport neutrality.
  8. Endpoints: Under development...

We'll take a look at each layer in turn and examine how they work together.

...

Data Bindings implement the mapping between XML and Java. Data bindings convert data to and from XML, produce XML schema, and provide support for wsdl2java code generation. Not all data bindings support all of this functionality. At very least, a data binding must provide the data conversion. See Data Binding Architecture for details. Currently supported databinding include JAXB 2.x, Aegis, Apache XMLBeans, Service Data Objects (SDO)and JiBX (under development).

Protocol Bindings

Bindings provide ways to map concrete formats & protocols on top of transports. A binding contains two main parts, a BindingFactory and a Binding. A BindingFactory builds a Binding from the service model's BindingInfo. The binding contains interceptors specific to the binding and also implements the createMessage() method, which creates a Message implementation specific for that binding. Currently supported protocol bindings include SOAP, REST, pure XML and CORBA.

The Soap Binding

The prototypical binding is SOAP. It has its own Message class called the SoapMessage. It adds the ability to hold the current SoapVersion and the headers for the message.

...

CXF includes its own transport abstraction layer to hide transport specific details from the binding and front end layers. Currently supported transports include: HTTP, Servlet, JMS, In-VM and many others via the Camel transport for CXF such as SMTP/POP3, TCP and Jabber.

Conduits

Conduits provide the basis for outgoing message sending. A Conduit is created from a ConduitInitiator. Sending a message is a multistep pocess:

...

The most common MessageObserver used in CXF is the ChainInitiationObserver. This takes the incoming message, creates a message Exchange & PhaseInterceptorChain, then starts the chain.

Endpoints

...

Putting it all Together

...

A JAX-WS example

Here's a small example of what might happen when we publish a service via the JAX-WS Endpoint.publish() method.

...