Class LibertyHTTPSOAP11Encoder

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, UnmodifiableComponent, MessageEncoder, HttpServletResponseMessageEncoder, SAMLMessageEncoder

public class LibertyHTTPSOAP11Encoder extends BaseHttpServletResponseXMLMessageEncoder implements SAMLMessageEncoder
Encoder for Liberty ID-WSF 2.0 SOAP 1.1 HTTP binding carrying SAML protocol messages used in SAML delegation.
  • Field Details

  • Constructor Details

    • LibertyHTTPSOAP11Encoder

      public LibertyHTTPSOAP11Encoder()
      Constructor.
  • Method Details

    • getBindingURI

      public String getBindingURI()
      Specified by:
      getBindingURI in interface SAMLMessageEncoder
    • prepareContext

      public void prepareContext() throws MessageEncodingException
      Specified by:
      prepareContext in interface MessageEncoder
      Overrides:
      prepareContext in class AbstractMessageEncoder
      Throws:
      MessageEncodingException
    • doEncode

      protected void doEncode() throws MessageEncodingException
      Specified by:
      doEncode in class AbstractMessageEncoder
      Throws:
      MessageEncodingException
    • storeSOAPEnvelope

      protected void storeSOAPEnvelope(Envelope envelope)
      Store the constructed SOAP envelope in the message context for later encoding.
      Parameters:
      envelope - the SOAP envelope
    • getSOAPEnvelope

      protected Envelope getSOAPEnvelope()
      Retrieve the previously stored SOAP envelope from the message context.
      Returns:
      the previously stored SOAP envelope
    • buildAndStoreSOAPMessage

      protected void buildAndStoreSOAPMessage(@Nonnull XMLObject payload)
      Builds the SOAP message to be encoded.
      Parameters:
      payload - body of the SOAP message
    • prepareHttpServletResponse

      protected void prepareHttpServletResponse() throws MessageEncodingException

      This implementation performs the following actions on the context's HttpServletResponse:

      1. Adds the HTTP header: "Cache-control: no-cache, no-store"
      2. Adds the HTTP header: "Pragma: no-cache"
      3. Sets the character encoding to: "UTF-8"
      4. Sets the content type to: "text/xml"
      5. Sets the SOAPAction HTTP header the value returned by getSOAPAction(), if that returns non-null.

      Subclasses should NOT set the SOAPAction HTTP header in this method. Instead, they should override the method getSOAPAction().

      Throws:
      MessageEncodingException - thrown if there is a problem preprocessing the transport
    • getSOAPAction

      protected String getSOAPAction()
      Determine the value of the SOAPAction HTTP header to send.

      The default behavior is to return the value of the SOAP Envelope's WS-Addressing Action header, if present.

      Returns:
      a SOAPAction HTTP header URI value
    • getHTTPResponseStatusCode

      protected int getHTTPResponseStatusCode()
      Get the HTTP response status code to return.
      Returns:
      the HTTP response status code
    • getMessageToLog

      protected XMLObject getMessageToLog()
      Overrides:
      getMessageToLog in class BaseHttpServletResponseXMLMessageEncoder