...
This document provides an architectural overview of the Apache CXF services framework.
Table of Contents
Architectural Goals and Constraints
...
How service calls are processed
...
600 | name | MessageFlowOnClientSide |
---|
|
Client Side
...
600 | name | MessageFlowOnServerSide |
---|
|
Server Side
Front-ends
Front-ends provide a programming model to interact with CXF. JAX-WS, JAX-RS, Simple and Javascript front-end APIs are provided by CXF . Each implementation is cleanly separated from the rest of CXF, just like the bindings and the core. Front-ends provide functionality through interceptors that are added to Services and Endpoints. See also Front-ends
...
An interesting feature of the PhaseInterceptorChain
is that it is reentrant. This can be powerful and slightly dangerous. This feature is only used in CXF during the sending of an outgoing message, The SoapOutInterceptor
is the best example:
Code Block |
---|
|
public void handleMessage(Message m) {
writeSoapEnvelopeStart();
writeSoapBodyStart();
// invoke next interceptor, which writes the contents of the SOAP Body
m.getInterceptorChain().doIntercept(m);
writeSoapBodyEnd();
writeSoapEnvelopeEnd();
}
|
...
The Soap
binding also adds a special type of interceptor called the SoapInterceptor
. The SoapInterceptor
adds two methods to the Interceptor
class:
Code Block |
---|
|
Set<URI> getRoles();
Set<QName> getUnderstoodHeaders();
|
...
Destinations are the basis for receiving incoming messages. A destination is created from a DestinationFactory
:
Code Block |
---|
|
DestinationFactoryManager dfManager = bus.getExtension(DestinationFactoryManager.class);
// Find a DestinationFactory for the SOAP HTTP transport
DestinationFactory df = dfManager.getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http");
// TODO: outline building of EndpointInfo
EndpointInfo endpointInfo = ...;
Destination destination = df.getDestination(endpointInfo);
|
MessageObservers can then be registered with Destinations. These listen for incoming messages:
Code Block |
---|
|
MessageObserver myObserver = ...;
destination.setMessageObserver(myObserver);
|
...