public class HeaderAndPayloadValidatingInterceptor
extends org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor
When the payload is invalid, this interceptor stops processing of the interceptor chain. Additionally, if the message is a SOAP request message, a SOAP Fault is created as reply. Invalid SOAP responses do not result in a fault.
Modifier and Type | Field and Description |
---|---|
static QName |
TRACE_HEADER_ELM |
Constructor and Description |
---|
HeaderAndPayloadValidatingInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
handleHeaderValidationErrors(org.springframework.ws.context.MessageContext messageContext,
ValidationException[] errors)
Template method that is called when the request SOAP headers contains validation errors.
|
boolean |
handleRequest(org.springframework.ws.context.MessageContext messageContext,
Object endpoint) |
void |
setFaultHeaderStringOrReason(String faultHeaderStringOrReason)
Sets fault reason when there is no requested header.
|
void |
setIgnoreRequests(Collection<String> ignoreRequests)
Sets request root element names which will be ignored from trace header checking.
|
void |
setValidateHeader(boolean validateHeader)
Sets whether validate SOAP header.
|
getValidationRequestSource, getValidationResponseSource
getAddValidationErrorDetail, getDetailElementName, getFaultStringOrReason, getFaultStringOrReasonLocale, handleRequestValidationErrors, setAddValidationErrorDetail, setDetailElementName, setFaultStringOrReason, setFaultStringOrReasonLocale
afterCompletion, afterPropertiesSet, getSchemaLanguage, getSchemas, handleFault, handleResponse, handleResponseValidationErrors, setErrorHandler, setSchema, setSchemaLanguage, setSchemas, setValidateRequest, setValidateResponse, setXsdSchema, setXsdSchemaCollection
public static QName TRACE_HEADER_ELM
public HeaderAndPayloadValidatingInterceptor()
public boolean handleRequest(org.springframework.ws.context.MessageContext messageContext, Object endpoint) throws IOException, SAXException, TransformerException
handleRequest
in interface org.springframework.ws.server.EndpointInterceptor
handleRequest
in class org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor
IOException
SAXException
TransformerException
protected boolean handleHeaderValidationErrors(org.springframework.ws.context.MessageContext messageContext, ValidationException[] errors) throws TransformerException
false
, i.e. do not process the request.messageContext
- the message contexterrors
- the validation errorstrue
to continue processing the request, false
(the default) otherwiseTransformerException
- if error occurs during the transformation processpublic void setValidateHeader(boolean validateHeader)
validateHeader
- true
for validation, otherwise false
public void setFaultHeaderStringOrReason(String faultHeaderStringOrReason)
faultHeaderStringOrReason
- the fault messagepublic void setIgnoreRequests(Collection<String> ignoreRequests)
ignoreRequests
- the array of element names, e.g.
{http://openhubframework.org/ws/SubscriberService-v1}getCounterDataRequest
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.