Class LibertyHTTPSOAP11Encoder
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder
net.shibboleth.idp.saml.saml2.profile.delegation.messaging.impl.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 Summary
FieldsModifier and TypeFieldDescriptionprivate SOAPObjectBuilder<Body>SOAP Body builder.private SOAPObjectBuilder<Envelope>SOAP Envelope builder.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildAndStoreSOAPMessage(XMLObject payload) Builds the SOAP message to be encoded.protected voiddoEncode()protected intGet the HTTP response status code to return.protected XMLObjectprotected StringDetermine the value of the SOAPAction HTTP header to send.protected EnvelopeRetrieve the previously stored SOAP envelope from the message context.voidprotected voidThis implementation performs the following actions on the context'sHttpServletResponse:protected voidstoreSOAPEnvelope(Envelope envelope) Store the constructed SOAP envelope in the message context for later encoding.Methods inherited from class org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder
encode, logEncodedMessage, marshallMessageMethods inherited from class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
doInitialize, getHttpServletResponse, getHttpServletResponseSupplier, setHttpServletResponse, setHttpServletResponseSupplierMethods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
doDestroy, getMessageContext, setMessageContextMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitializedMethods inherited from interface org.opensaml.messaging.encoder.MessageEncoder
encode, setMessageContext
-
Field Details
-
log
private final org.slf4j.Logger logClass logger. -
envBuilder
SOAP Envelope builder. -
bodyBuilder
SOAP Body builder.
-
-
Constructor Details
-
LibertyHTTPSOAP11Encoder
public LibertyHTTPSOAP11Encoder()Constructor.
-
-
Method Details
-
getBindingURI
- Specified by:
getBindingURIin interfaceSAMLMessageEncoder
-
prepareContext
- Specified by:
prepareContextin interfaceMessageEncoder- Overrides:
prepareContextin classAbstractMessageEncoder- Throws:
MessageEncodingException
-
doEncode
- Specified by:
doEncodein classAbstractMessageEncoder- Throws:
MessageEncodingException
-
storeSOAPEnvelope
Store the constructed SOAP envelope in the message context for later encoding.- Parameters:
envelope- the SOAP envelope
-
getSOAPEnvelope
Retrieve the previously stored SOAP envelope from the message context.- Returns:
- the previously stored SOAP envelope
-
buildAndStoreSOAPMessage
Builds the SOAP message to be encoded.- Parameters:
payload- body of the SOAP message
-
prepareHttpServletResponse
This implementation performs the following actions on the context's
HttpServletResponse:- Adds the HTTP header: "Cache-control: no-cache, no-store"
- Adds the HTTP header: "Pragma: no-cache"
- Sets the character encoding to: "UTF-8"
- Sets the content type to: "text/xml"
- 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
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
- Overrides:
getMessageToLogin classBaseHttpServletResponseXMLMessageEncoder
-