Class AbstractAddressingEndpointMapping

java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.soap.addressing.server.AbstractAddressingEndpointMapping
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, EndpointMapping, SoapEndpointMapping
Direct Known Subclasses:
AbstractActionEndpointMapping

public abstract class AbstractAddressingEndpointMapping extends TransformerObjectSupport implements SoapEndpointMapping, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered
Abstract base class for EndpointMapping implementations that handle WS-Addressing. Besides the normal SoapEndpointMapping properties, this mapping has a versions property, which defines the WS-Addressing specifications supported. By default, these are Addressing200408 and Addressing10.

The messageIdStrategy property defines the strategy to use for creating reply MessageIDs. By default, this is the UuidMessageIdStrategy.

The messageSenders are used to send out-of-band reply messages. If a request messages defines a non-anonymous reply address, these senders will be used to send the message.

This mapping (and all subclasses) uses an implicit WS-Addressing EndpointInterceptor, which is added in every EndpointInvocationChain produced. As such, this mapping does not have the standard interceptors property, but rather a preInterceptors and postInterceptors property, which are added before and after the implicit WS-Addressing interceptor, respectively.

Since:
1.5.0
Author:
Arjen Poutsma, Nate Stoddard
  • Constructor Details

    • AbstractAddressingEndpointMapping

      protected AbstractAddressingEndpointMapping()
      Protected constructor. Initializes the default settings.
  • Method Details

    • initDefaultStrategies

      protected void initDefaultStrategies()
      Initializes the default implementation for this mapping's strategies: the Addressing200408 and Addressing10 versions of the specification, and the UuidMessageIdStrategy.
    • setActorOrRole

      public final void setActorOrRole(String actorOrRole)
      Description copied from interface: SoapEndpointMapping
      Sets a single SOAP actor/actorOrRole to apply to all endpoints mapped by the delegate endpoint mapping.
      Specified by:
      setActorOrRole in interface SoapEndpointMapping
    • setActorsOrRoles

      public final void setActorsOrRoles(String[] actorsOrRoles)
      Description copied from interface: SoapEndpointMapping
      Sets the array of SOAP actors/actorsOrRoles to apply to all endpoints mapped by the delegate endpoint mapping.
      Specified by:
      setActorsOrRoles in interface SoapEndpointMapping
    • setUltimateReceiver

      public final void setUltimateReceiver(boolean ultimateReceiver)
      Description copied from interface: SoapEndpointMapping
      Indicates whether this the endpoint fulfills the SOAP 1.2 Ultimate Receiver role.
      Specified by:
      setUltimateReceiver in interface SoapEndpointMapping
    • getApplicationContext

      public org.springframework.context.ApplicationContext getApplicationContext()
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getOrder

      public final int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • setOrder

      public final void setOrder(int order)
      Specify the order value for this mapping.

      Default value is Integer.MAX_VALUE, meaning that it's non-ordered.

      See Also:
      • Ordered.getOrder()
    • setPreInterceptors

      public final void setPreInterceptors(EndpointInterceptor[] preInterceptors)
      Set additional interceptors to be applied before the implicit WS-Addressing interceptor, e.g. XwsSecurityInterceptor.
    • setPostInterceptors

      public final void setPostInterceptors(EndpointInterceptor[] postInterceptors)
      Set additional interceptors to be applied after the implicit WS-Addressing interceptor, e.g. PayloadLoggingInterceptor.
    • setMessageIdStrategy

      public final void setMessageIdStrategy(MessageIdStrategy messageIdStrategy)
      Sets the message id strategy used for creating WS-Addressing MessageIds.

      By default, the UuidMessageIdStrategy is used.

    • getMessageIdStrategy

      public MessageIdStrategy getMessageIdStrategy()
      Returns the message id strategy used for creating WS-Addressing MessageIds.
    • setMessageSender

      public final void setMessageSender(WebServiceMessageSender messageSender)
      Sets a single message senders, which is used to send out-of-band reply messages. If a request messages defines a non-anonymous reply address, this senders will be used to send the message.
      Parameters:
      messageSender - the message sender
    • setMessageSenders

      public final void setMessageSenders(WebServiceMessageSender[] messageSenders)
      Sets the message senders, which are used to send out-of-band reply messages. If a request messages defines a non-anonymous reply address, these senders will be used to send the message.
      Parameters:
      messageSenders - the message senders
    • getMessageSenders

      public final WebServiceMessageSender[] getMessageSenders()
      Returns the message senders, which are used to send out-of-band reply messages.
      Returns:
      the message sender
    • setVersions

      public final void setVersions(AddressingVersion[] versions)
      Sets the WS-Addressing versions to be supported by this mapping.

      By default, this array is set to support the August 2004 and the May 2006 versions of the specification.

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • getEndpoint

      public final EndpointInvocationChain getEndpoint(MessageContext messageContext) throws TransformerException
      Description copied from interface: EndpointMapping
      Returns an endpoint and any interceptors for this message context. The choice may be made on message contents, transport request url, a routing table, or any factor the implementing class chooses.

      The returned EndpointExecutionChain contains an endpoint Object, rather than even a tag interface, so that endpoints are not constrained in any way. For example, a EndpointAdapter could be written to allow another framework's endpoint objects to be used.

      Returns null if no match was found. This is by design. The MessageDispatcher will query all registered EndpointMapping beans to find a match, and only decide there is an error if none can find an endpoint.

      Specified by:
      getEndpoint in interface EndpointMapping
      Returns:
      a HandlerExecutionChain instance containing endpoint object and any interceptors, or null if no mapping is found
      Throws:
      TransformerException
    • getMessageSenders

      protected WebServiceMessageSender[] getMessageSenders(Object endpoint)
      Returns the message senders for the given endpoint. Default implementation returns getMessageSenders()
      Parameters:
      endpoint - the endpoint
      Returns:
      the message senders for the given endpoint
    • getMessageIdStrategy

      protected MessageIdStrategy getMessageIdStrategy(Object endpoint)
      Returns the message ID strategy for the given endpoint. Default implementation returns getMessageIdStrategy()
      Parameters:
      endpoint - the endpoint
      Returns:
      the message ID strategy for the given endpoint
    • getEndpointInternal

      protected abstract Object getEndpointInternal(MessageAddressingProperties map)
      Lookup an endpoint for the given MessageAddressingProperties, returning null if no specific one is found. This template method is called by getEndpoint(MessageContext).
      Parameters:
      map - the message addressing properties
      Returns:
      the endpoint, or null
    • getResponseAction

      protected abstract URI getResponseAction(Object endpoint, MessageAddressingProperties requestMap)
      Provides the WS-Addressing Action for response messages, given the endpoint, and request Message Addressing Properties.
      Parameters:
      endpoint - the mapped endpoint
      requestMap - the MAP for the request
      Returns:
      the response Action
    • getFaultAction

      protected abstract URI getFaultAction(Object endpoint, MessageAddressingProperties requestMap)
      Provides the WS-Addressing Action for response fault messages, given the endpoint, and request Message Addressing Properties.
      Parameters:
      endpoint - the mapped endpoint
      requestMap - the MAP for the request
      Returns:
      the response Action