Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fix some typos

Support for Multiplexed EndpointReferences in CXF allows a single stateless service instance to represent/impersonate multiple service instances. The single service does not maintain any state itself, but instead uses attributes of the current target EndpointReference to identify instance data. The piggybacking of state in an EndpointReference is a form of applicaion application level multiplexing.

To illustrate, consider a simple web service called Number that represents an integer and suports supports a single operation isEven that returns true iff the Number is even. Consider also a NumberFactory service that returns Endpoint References(EPRs) to Numbers through an operation create(int).

A typical implementation of NumberFactory.create() would instanciate instantiate and publish an endpoint for each requested integer value, returning the corresponding EPR to the caller. Given the infinite set of possible Number values, this implementation would scale poorly as the number of calls to create different values increase.

Enter multiplexed endpoint references. The implementation of NumberFactory.create() instanciates instantiates and publishes a single template service. Then for each unique value of Number, the implementation generates (using a CXF API) a multiplexed EPR for that particular value. This EPR is returned to the caller.

...

How does it Work

The API uses WS-Addressing(WS-A) reference parameters to embedd embed the users state in an EndpointReference. The referece reference parameters are part of the EPR that is returned to the caller. WS-Addressing A interceptors are used to propagate the reference parameters as a soap header on subsequent invocations using the returned EPR. On the receiving side, the current WS-Addressing A MEPs are queried to extract the state from the reference parameters.

...

WS-A provides a transport/protocol neutral approach to state transfer and is the default mechanism for multiplexing supported by CXF. However some transports, notably HTTP, have implicit support for mutiplexing multiplexing in the form of contexts and query parameters. The CXF HTTP transport supports a multiplexWithAddress configuration attribute that when enabled, negates the use of WS-A and forces the state to be embedded in the URL context.

...

JAX-WS 2.0 provides APIs that allow a port to be created with an EPR. CXF is working towards JAX-WS 1.0 certification which is incompatable incompatible with JAX-WS 2.0. Thus in the short term, CXF will not expose the usefull useful JAX-WS 2.0 API. As an interm interim solution, CXF provides a utility class ServiceDelegateAccessor that allows a JAX-WS client to reference the underlying provider implementation object on which a getPort(EndpointReferenceType ..) method exists.

...