Class HttpClientRequestSOAP11Encoder
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.encoder.AbstractMessageEncoder
-
- org.opensaml.messaging.encoder.httpclient.AbstractHttpClientRequestMessageEncoder
-
- org.opensaml.messaging.encoder.httpclient.BaseHttpClientRequestXMLMessageEncoder
-
- org.opensaml.soap.client.soap11.encoder.http.impl.HttpClientRequestSOAP11Encoder
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,HttpClientRequestMessageEncoder,MessageEncoder
public class HttpClientRequestSOAP11Encoder extends BaseHttpClientRequestXMLMessageEncoder
Basic SOAP 1.1 encoder for HTTP transport via an HttpClient'sHttpRequest.
-
-
Field Summary
Fields Modifier and Type Field Description private SOAPObjectBuilder<Body>bodyBuilderSOAP Body builder.private SOAPObjectBuilder<Envelope>envBuilderSOAP Envelope builder.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description HttpClientRequestSOAP11Encoder()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildAndStoreSOAPMessage(XMLObject payload)Builds the SOAP message to be encoded.protected org.apache.http.HttpEntitycreateRequestEntity(Envelope message, Charset charset)Create the request entity that makes up the POST message body.protected voiddoEncode()org.apache.http.client.methods.HttpPostgetHttpRequest()protected XMLObjectgetMessageToLog()protected StringgetSOAPAction()Determine the value of the SOAPAction HTTP header to send.protected EnvelopegetSOAPEnvelope()Retrieve the previously stored SOAP envelope from the message context.voidprepareContext()protected voidprepareHttpRequest()This implementation performs the following actions on the context'sHttpRequest:voidsetHttpRequest(org.apache.http.HttpRequest httpRequest)protected voidstoreSOAPEnvelope(Envelope envelope)Store the constructed SOAP envelope in the message context for later encoding.-
Methods inherited from class org.opensaml.messaging.encoder.httpclient.BaseHttpClientRequestXMLMessageEncoder
encode, logEncodedMessage, marshallMessage
-
Methods inherited from class org.opensaml.messaging.encoder.httpclient.AbstractHttpClientRequestMessageEncoder
doDestroy, doInitialize
-
Methods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
getMessageContext, setMessageContext
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Methods inherited from interface org.opensaml.messaging.encoder.MessageEncoder
setMessageContext
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
Class logger.
-
envBuilder
private SOAPObjectBuilder<Envelope> envBuilder
SOAP Envelope builder.
-
bodyBuilder
private SOAPObjectBuilder<Body> bodyBuilder
SOAP Body builder.
-
-
Method Detail
-
getHttpRequest
@Nullable public org.apache.http.client.methods.HttpPost getHttpRequest()
This encoder implementation only operates on instances of
HttpPost.- Specified by:
getHttpRequestin interfaceHttpClientRequestMessageEncoder- Overrides:
getHttpRequestin classAbstractHttpClientRequestMessageEncoder
-
setHttpRequest
public void setHttpRequest(org.apache.http.HttpRequest httpRequest)
This encoder implementation only operates on instances of
HttpPost.- Specified by:
setHttpRequestin interfaceHttpClientRequestMessageEncoder- Overrides:
setHttpRequestin classAbstractHttpClientRequestMessageEncoder
-
prepareContext
public void prepareContext() throws MessageEncodingException- Specified by:
prepareContextin interfaceMessageEncoder- Overrides:
prepareContextin classAbstractMessageEncoder- Throws:
MessageEncodingException
-
doEncode
protected void doEncode() throws MessageEncodingException- Specified by:
doEncodein classAbstractMessageEncoder- Throws:
MessageEncodingException
-
createRequestEntity
protected org.apache.http.HttpEntity createRequestEntity(@Nonnull Envelope message, @Nullable Charset charset) throws MessageEncodingExceptionCreate the request entity that makes up the POST message body.- Parameters:
message- message to be sentcharset- character set used for the message- Returns:
- request entity that makes up the POST message body
- Throws:
MessageEncodingException- thrown if the message could not be marshalled
-
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
-
prepareHttpRequest
protected void prepareHttpRequest() throws MessageEncodingExceptionThis implementation performs the following actions on the context's
HttpRequest:- 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
- Sets the SOAPAction HTTP header the value returned by
-
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
-
getMessageToLog
protected XMLObject getMessageToLog()
- Overrides:
getMessageToLogin classBaseHttpClientRequestXMLMessageEncoder
-
-