@ OverrideOnDemand protected void validateOutgoingBusinessDocument ( @ Nonnull final Element aXML ) throws AS2ClientBuilderException { if ( m_aVESRegistry == null ) { // Create lazily m_aVESRegistry = createValidationRegistry ( ) ; } final IValidationExecutorSet aVES = m_aVESRegistry . getOfID ( m_aVESID ) ; if ( aVES == null ) throw new AS2ClientBuilderException ( "The validation executor set ID " + m_aVESID . getAsSingleID ( ) + " is unknown!" ) ; final ValidationExecutionManager aVEM = aVES . createExecutionManager ( ) ; final ValidationResultList aValidationResult = aVEM . executeValidation ( ValidationSource . create ( null , aXML ) , ( Locale ) null ) ; if ( aValidationResult . containsAtLeastOneError ( ) ) throw new AS2ClientBuilderValidationException ( aValidationResult ) ; }
Perform the standard PEPPOL validation of the outgoing business document before sending takes place . In case validation fails an exception is thrown . The validation is configured using the validation key . This method is only called when a validation key was set .