Class ValidatorInterceptor

java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.schemavalidation.ValidatorInterceptor
All Implemented Interfaces:
Interceptor, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class ValidatorInterceptor extends AbstractInterceptor implements org.springframework.context.ApplicationContextAware
Basically switches over WSDLValidator, XMLSchemaValidator, JSONValidator and SchematronValidator depending on the attributes.
Topic
8. SOAP based Web Services
  • Constructor Details

    • ValidatorInterceptor

      public ValidatorInterceptor()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • init

      public void init() throws Exception
      Description copied from class: AbstractInterceptor
      Called after parsing is complete and this has been added to the object tree (whose root is Router).
      Overrides:
      init in class AbstractInterceptor
      Throws:
      Exception
    • handleRequest

      public Outcome handleRequest(Exchange exc) throws Exception
      Specified by:
      handleRequest in interface Interceptor
      Overrides:
      handleRequest in class AbstractInterceptor
      Throws:
      Exception
    • handleResponse

      public Outcome handleResponse(Exchange exc) throws Exception
      Specified by:
      handleResponse in interface Interceptor
      Overrides:
      handleResponse in class AbstractInterceptor
      Throws:
      Exception
    • setWsdl

      public void setWsdl(String wsdl)
      Description
      The WSDL (URL or file) to validate against.
      Example
      "http://predic8.com:8080/material/ArticleService?wsdl
    • getWsdl

      public String getWsdl()
    • getSchema

      public String getSchema()
    • setSchema

      public void setSchema(String schema)
      Description
      The XSD Schema (URL or file) to validate against.
      Example
      http://www.predic8.com/schemas/order.xsd
    • getFailureHandler

      public String getFailureHandler()
    • setFailureHandler

      public void setFailureHandler(String failureHandler)
      Default
      response
      Description
      If "response", the HTTP response will include a detailled error message. If "log", the response will be generic and the validation error will be logged.
      Example
      log
    • getJsonSchema

      public String getJsonSchema()
    • setJsonSchema

      public void setJsonSchema(String jsonSchema)
      Description
      The JSON Schema (URL or file) to validate against.
      Example
      examples/validation/json-schema/schema2000.json
    • getSchematron

      public String getSchematron()
    • setSchematron

      public void setSchematron(String schematron)
      Description
      The Schematron schema (URL or file) to validate against.
      Example
      examples/validation/schematron/car-schematron.xml
    • isSkipFaults

      public boolean isSkipFaults()
    • setSkipFaults

      public void setSkipFaults(boolean skipFaults)
      Default
      false
      Description
      Whether to skip validation for SOAP fault messages.
    • getServiceName

      public String getServiceName()
    • setServiceName

      public void setServiceName(String serviceName)
      Description
      Optional name of a serivce element in a WSDL. If specified it will be checked if the SOAP element is possible for that service.
    • init

      public void init(Router router) throws Exception
      Specified by:
      init in interface Interceptor
      Overrides:
      init in class AbstractInterceptor
      Throws:
      Exception
    • setResourceResolver

      public void setResourceResolver(ResolverMap resourceResolver)
    • getShortDescription

      public String getShortDescription()
      Specified by:
      getShortDescription in interface Interceptor
      Overrides:
      getShortDescription in class AbstractInterceptor
    • getLongDescription

      public String getLongDescription()
      Specified by:
      getLongDescription in interface Interceptor
      Overrides:
      getLongDescription in class AbstractInterceptor