public interface ClientInterceptor
WebServiceTemplate
, to add common
pre- and postprocessing behavior without needing to modify payload handling code.
A ClientInterceptor
gets called after payload creation (using WebServiceTemplate.marshalSendAndReceive(Object)
or similar methods, and after
callback
invocation, but before the message is
sent over the WebServiceConnection
. This mechanism can be used for a large field of preprocessing aspects,
e.g. for authorization checks, or message header checks. Its main purpose is to allow for factoring out meta-data
(i.e. SoapHeader
) related code.
Client interceptors are defined on a WebServiceTemplate
, using the interceptors
property.WebServiceTemplate.setInterceptors(ClientInterceptor[])
Modifier and Type | Method and Description |
---|---|
boolean |
handleFault(MessageContext messageContext)
Processes the incoming response fault.
|
boolean |
handleRequest(MessageContext messageContext)
Processes the outgoing request message.
|
boolean |
handleResponse(MessageContext messageContext)
Processes the incoming response message.
|
boolean handleRequest(MessageContext messageContext) throws WebServiceClientException
messageContext
- contains the outgoing request messagetrue
to continue processing of the request interceptors; false
to indicate
blocking of the request endpoint chainWebServiceClientException
- in case of errorsMessageContext.getRequest()
boolean handleResponse(MessageContext messageContext) throws WebServiceClientException
WebServiceTemplate
.messageContext
- contains the outgoing request messagetrue
to continue processing of the request interceptors; false
to indicate
blocking of the response endpoint chainWebServiceClientException
- in case of errorsMessageContext.getResponse()
boolean handleFault(MessageContext messageContext) throws WebServiceClientException
WebServiceTemplate
.messageContext
- contains the outgoing request messagetrue
to continue processing of the request interceptors; false
to indicate
blocking of the request endpoint chainWebServiceClientException
- in case of errorsMessageContext.getResponse()
,
FaultAwareWebServiceMessage.hasFault()
Copyright © 2005–2015 The Spring Web Services Framework. All rights reserved.