MessageType - the message type of the message context on which to operatepublic class HTTPSOAP11Encoder<MessageType extends XMLObject> extends BaseHttpServletResponseXMLMessageEncoder<MessageType>
| Constructor and Description |
|---|
HTTPSOAP11Encoder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildAndStoreSOAPMessage(XMLObject payload)
Builds the SOAP message to be encoded.
|
protected void |
doEncode()
Performs the encoding logic.
|
protected int |
getHTTPResponseStatusCode()
Get the HTTP response status code to return.
|
protected XMLObject |
getMessageToLog()
Get the XMLObject which will be logged as the protocol message.
|
protected String |
getSOAPAction()
Determine the value of the SOAPAction HTTP header to send.
|
protected Envelope |
getSOAPEnvelope()
Retrieve the previously stored SOAP envelope from the message context.
|
void |
prepareContext()
This method should prepare the message context by creating and populating any binding-specific data structures
required in the MessageContext, prior to actually encoding.
|
protected void |
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.
|
protected void |
storeSOAPEnvelope(Envelope envelope)
Store the constructed SOAP envelope in the message context for later encoding.
|
encode, logEncodedMessage, marshallMessagedoDestroy, doInitialize, getHttpServletResponse, setHttpServletResponsegetMessageContext, setMessageContextdestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetMessageContextpublic void prepareContext()
throws MessageEncodingException
This method should be called after the MessageContext has been set, and before any binding-specific Handler or HandlerChains are invoked.
Example: For a SOAP encoder, this method would create and store the basic SOAP Envelope structure in the message context, so that Handlers that are invoked have a place to which to add headers.
This method may be a no-op if not required by the binding, or if the message type of the context implies that the binding-specific structures have already been created elsewhere (e.g. message-oriented code where the calling code already knows its SOAP, and is operating on the raw SOAP envelope anyway).
. Default implementation is a no-op.prepareContext in interface MessageEncoder<MessageType extends XMLObject>prepareContext in class AbstractMessageEncoder<MessageType extends XMLObject>MessageEncodingException - if there is a problem preparing the message context for encodingprotected void doEncode()
throws MessageEncodingException
doEncode in class AbstractMessageEncoder<MessageType extends XMLObject>MessageEncodingException - thrown if there is a problem encoding the messageprotected void storeSOAPEnvelope(Envelope envelope)
envelope - the SOAP envelopeprotected Envelope getSOAPEnvelope()
protected void buildAndStoreSOAPMessage(@Nonnull XMLObject payload)
payload - body of the SOAP messageprotected void prepareHttpServletResponse()
throws MessageEncodingException
This implementation performs the following actions on the context's HttpServletResponse:
getSOAPAction(), if
that returns non-null.
Subclasses should NOT set the SOAPAction HTTP header in this method. Instead, they should override
the method getSOAPAction().
MessageEncodingException - thrown if there is a problem preprocessing the transportprotected String getSOAPAction()
The default behavior is to return the value of the SOAP Envelope's WS-Addressing Action header, if present.
protected int getHTTPResponseStatusCode()
protected XMLObject getMessageToLog()
getMessageToLog in class BaseHttpServletResponseXMLMessageEncoder<MessageType extends XMLObject>Copyright © 2021. All rights reserved.