Class AbstractFaultCreatingValidatingInterceptor

All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, EndpointInterceptor
Direct Known Subclasses:
PayloadValidatingInterceptor

public abstract class AbstractFaultCreatingValidatingInterceptor extends AbstractValidatingInterceptor
Subclass of AbstractValidatingInterceptor that creates a SOAP Fault whenever the request message cannot be validated. The contents of the SOAP Fault can be specified by setting the addValidationErrorDetail, faultStringOrReason, or detailElementName properties. Further customizing can be accomplished by overriding handleRequestValidationErrors.
Since:
1.0.0
Author:
Arjen Poutsma
See Also:
  • Field Details

  • Constructor Details

    • AbstractFaultCreatingValidatingInterceptor

      public AbstractFaultCreatingValidatingInterceptor()
  • Method Details

    • getAddValidationErrorDetail

      public boolean getAddValidationErrorDetail()
      Returns whether a SOAP Fault detail element should be created when a validation error occurs. This detail element will contain the exact validation errors. It is only added when the underlying message is a SoapMessage. Defaults to true.
      See Also:
    • setAddValidationErrorDetail

      public void setAddValidationErrorDetail(boolean addValidationErrorDetail)
      Indicates whether a SOAP Fault detail element should be created when a validation error occurs. This detail element will contain the exact validation errors. It is only added when the underlying message is a SoapMessage. Defaults to true.
      See Also:
    • getDetailElementName

      public QName getDetailElementName()
      Returns the fault detail element name when validation errors occur on the request.
    • setDetailElementName

      public void setDetailElementName(QName detailElementName)
      Sets the fault detail element name when validation errors occur on the request. Defaults to DEFAULT_DETAIL_ELEMENT_NAME.
      See Also:
    • getFaultStringOrReason

      public String getFaultStringOrReason()
      Sets the SOAP faultstring or Reason used when validation errors occur on the request.
    • setFaultStringOrReason

      public void setFaultStringOrReason(String faultStringOrReason)
      Sets the SOAP faultstring or Reason used when validation errors occur on the request. It is only added when the underlying message is a SoapMessage. Defaults to DEFAULT_FAULTSTRING_OR_REASON.
      See Also:
    • getFaultStringOrReasonLocale

      public Locale getFaultStringOrReasonLocale()
      Returns the SOAP fault reason locale used when validation errors occur on the request.
    • setFaultStringOrReasonLocale

      public void setFaultStringOrReasonLocale(Locale faultStringOrReasonLocale)
      Sets the SOAP fault reason locale used when validation errors occur on the request. It is only added when the underlying message is a SoapMessage. Defaults to English.
      See Also:
    • handleRequestValidationErrors

      protected boolean handleRequestValidationErrors(MessageContext messageContext, SAXParseException[] errors) throws TransformerException
      Template method that is called when the request message contains validation errors. This implementation logs all errors, returns false, and creates a client or sender SoapFault, adding a SoapFaultDetail with all errors if the addValidationErrorDetail property is true.
      Overrides:
      handleRequestValidationErrors in class AbstractValidatingInterceptor
      Parameters:
      messageContext - the message context
      errors - the validation errors
      Returns:
      true to continue processing the request, false (the default) otherwise
      Throws:
      TransformerException