|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.ws.endpoint.PayloadValidatingInterceptor
public class PayloadValidatingInterceptor
Interceptor that validates the contents of WebServiceMessages using a schema. Allows for both W3C XML
and RELAX NG schemas.
schema property. By default, only the request message is
validated, but this behaviour can be changed using the validateRequest and validateResponse
properties. Responses that contains faults are not validated.
setSchema(org.springframework.core.io.Resource),
setValidateRequest(boolean),
setValidateResponse(boolean)| Constructor Summary | |
|---|---|
PayloadValidatingInterceptor()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
boolean |
handleFault(MessageContext messageContext,
java.lang.Object endpoint)
Returns true, i.e. |
boolean |
handleRequest(MessageContext messageContext,
java.lang.Object endpoint)
Validates the request message in the given message context. |
boolean |
handleResponse(MessageContext messageContext,
java.lang.Object endpoint)
Validates the response message in the given message context. |
void |
setSchema(org.springframework.core.io.Resource schema)
Sets the schema resource to use for validation. |
void |
setSchemaLanguage(java.lang.String schemaLanguage)
Sets the schema language. |
void |
setValidateRequest(boolean validateRequest)
Indicates whether the request should be validated against the schema. |
void |
setValidateResponse(boolean validateResponse)
Indicates whether the response should be validated against the schema. |
boolean |
understands(SoapHeaderElement header)
Returns false, i.e. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PayloadValidatingInterceptor()
| Method Detail |
|---|
public void setSchema(org.springframework.core.io.Resource schema)
public void setSchemaLanguage(java.lang.String schemaLanguage)
http://www.w3.org/2001/XMLSchema".
XmlValidatorFactory.SCHEMA_W3C_XML,
XmlValidatorFactory.SCHEMA_RELAX_NGpublic void setValidateRequest(boolean validateRequest)
true.
public void setValidateResponse(boolean validateResponse)
false.
public boolean handleRequest(MessageContext messageContext,
java.lang.Object endpoint)
throws java.io.IOException,
org.xml.sax.SAXException
validateRequest is set to true, which is the default.
Returns true if the request is valid, or false if it isn't. Additionally, when the
messageContext is a SoapMessageContext, a SOAP Fault is added as response.
handleRequest in interface EndpointInterceptormessageContext - the message contextendpoint -
true if the message is valid; false otherwise
java.io.IOException
org.xml.sax.SAXExceptionsetValidateRequest(boolean)
public boolean handleResponse(MessageContext messageContext,
java.lang.Object endpoint)
throws java.io.IOException,
org.xml.sax.SAXException
validateResponse is set to true, which is not the default.
Returns true if the request is valid, or false if it isn't.
handleResponse in interface EndpointInterceptormessageContext - the message context.endpoint -
true if the response is valid; false otherwise
java.io.IOException
org.xml.sax.SAXExceptionsetValidateResponse(boolean)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception
public boolean handleFault(MessageContext messageContext,
java.lang.Object endpoint)
throws java.lang.Exception
true, i.e. SOAP Faults are not validated.
handleFault in interface SoapEndpointInterceptormessageContext - contains both request and response messages, the response should contains a SOAP Faultendpoint - chosen endpoint to invoke
true to continue processing of the reponse interceptor chain; false to indicate
blocking of the response handler chain.
java.lang.Exceptionpublic boolean understands(SoapHeaderElement header)
false, i.e. all SOAP Headers are not understood.
understands in interface SoapEndpointInterceptorheader - the header
true if understood, false otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||