Class ContentBasedDispatchPolicy

java.lang.Object
org.apache.axis2.dispatchers.ContentBasedDispatchPolicy

public final class ContentBasedDispatchPolicy extends Object
Whether a service may be selected from the content of the message body.

The default inflow phase order is Transport, Addressing, Security, PreDispatch, Dispatch. A service bound in the Dispatch phase is therefore bound after the Security phase has already run, and DispatchPhase installs only the phases that follow Dispatch, so Security is never revisited. Per-service module handlers -- the WS-Security ones among them -- live in that global Security phase.

The body-namespace dispatchers select a service from a string the caller supplies, so with a request URI that names no service they let the caller pick the service only after the phase that would have authenticated the request for it has run against no service at all. That is why this is off unless an operator asks for it: allowContentBasedServiceDispatch, set on the AxisConfiguration in axis2.xml, defaults to false.

Dispatch by request URI, SOAPAction and WS-Addressing is unaffected; those bind the service before the Security phase runs. Only deployments that genuinely address services by body namespace need to turn this on, and they should not rely on per-service security modules while it is on.

  • Field Details

    • ALLOW_CONTENT_BASED_DISPATCH

      public static final String ALLOW_CONTENT_BASED_DISPATCH
      Name of the AxisConfiguration parameter, default false.
      See Also:
  • Method Details

    • isAllowed

      public static boolean isAllowed(MessageContext messageContext)
      Parameters:
      messageContext - the message being dispatched; may be null
      Returns:
      whether a service may be selected from the message body