Class HttpClientResponseSOAP11Decoder
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.messaging.decoder.AbstractMessageDecoder
org.opensaml.messaging.decoder.httpclient.AbstractHttpClientResponseMessageDecoder
org.opensaml.messaging.decoder.httpclient.BaseHttpClientResponseXMLMessageDecoder
org.opensaml.soap.client.soap11.decoder.http.impl.HttpClientResponseSOAP11Decoder
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,HttpClientResponseMessageDecoder,MessageDecoder
- Direct Known Subclasses:
HttpClientResponseSOAP11Decoder,HttpClientResponseSOAP11Decoder
Basic SOAP 1.1 decoder for HTTP transport via an HttpClient's
HttpResponse.
This decoder takes a mandatory MessageHandler instance which is used to
populate the message that is returned as the MessageContext.getMessage().
A SOAP message oriented message exchange style might just populate the Envelope as the message. An application-specific payload-oriented message exchange would handle a specific type of payload structure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MessageHandlerMessage handler to use in processing the message body.private final org.slf4j.LoggerLogger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MessageDecodingExceptionbuildFaultException(org.apache.http.HttpResponse response) Build an exception by processing a fault response, i.e.protected voiddoDecode()Performs the decoding logic.protected voidGet the configured body handler MessageHandler.protected FaultReturn the Fault element from the SOAP message, if any.protected XMLObjectGet the XMLObject which will be logged as the protocol message.protected voidprocessSuccessResponse(org.apache.http.HttpResponse httpResponse, SOAP11Context soapContext) Process a successful response, i.e.voidsetBodyHandler(MessageHandler newBodyHandler) Set the configured body handler MessageHandler.Methods inherited from class org.opensaml.messaging.decoder.httpclient.BaseHttpClientResponseXMLMessageDecoder
decode, doDestroy, getParserPool, logDecodedMessage, setParserPool, unmarshallMessageMethods inherited from class org.opensaml.messaging.decoder.httpclient.AbstractHttpClientResponseMessageDecoder
getHttpResponse, setHttpResponseMethods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
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.decoder.MessageDecoder
getMessageContext
-
Field Details
-
log
private final org.slf4j.Logger logLogger. -
bodyHandler
Message handler to use in processing the message body.
-
-
Constructor Details
-
HttpClientResponseSOAP11Decoder
public HttpClientResponseSOAP11Decoder()
-
-
Method Details
-
getBodyHandler
Get the configured body handler MessageHandler.- Returns:
- Returns the bodyHandler.
-
setBodyHandler
Set the configured body handler MessageHandler.- Parameters:
newBodyHandler- The bodyHandler to set.
-
doDecode
Performs the decoding logic. By the time this is called, this decoder has already been initialized and checked to ensure that it has not been destroyed.- Specified by:
doDecodein classAbstractMessageDecoder- Throws:
MessageDecodingException- thrown if there is a problem decoding the message
-
processSuccessResponse
protected void processSuccessResponse(org.apache.http.HttpResponse httpResponse, SOAP11Context soapContext) throws MessageDecodingException, IOException Process a successful response, i.e. one where the HTTP response code was 200.- Parameters:
httpResponse- the HTTP client responsesoapContext- the SOAP11Context instance- Throws:
MessageDecodingException- if message can not be unmarshalledIOException- if there is a problem with the response entity input stream
-
buildFaultException
protected MessageDecodingException buildFaultException(org.apache.http.HttpResponse response) throws MessageDecodingException, IOException Build an exception by processing a fault response, i.e. one where the HTTP response code was 500.- Parameters:
response- the HTTP client response- Returns:
- the message decoding exception representing the SOAP fault
- Throws:
MessageDecodingException- if message can not be unmarshalledIOException- if there is a problem with the response entity input stream
-
getFault
Return the Fault element from the SOAP message, if any.- Parameters:
soapMessage- the SOAP 1.1. Envelope being processed- Returns:
- the first Fault element found, or null
-
doInitialize
- Overrides:
doInitializein classBaseHttpClientResponseXMLMessageDecoder- Throws:
ComponentInitializationException
-
getMessageToLog
Get the XMLObject which will be logged as the protocol message.- Overrides:
getMessageToLogin classBaseHttpClientResponseXMLMessageDecoder- Returns:
- the XMLObject message considered to be the protocol message for logging purposes
-