예제 #1
0
        /// <summary>
        /// Fill configuration section with default live values
        /// </summary>
        public virtual void SetSendingOptionConfig()
        {
            SendingOptionConfig SendingOptionConfig = ConfigurationHandler.GetConfigurationSection <SendingOptionConfig>();

            SendingOptionConfig.SchemaValidation     = bool.TrueString;
            SendingOptionConfig.SchematronValidation = bool.TrueString;
        }
예제 #2
0
        public bool Validate(OiosiMessage oiosiMessage)
        {
            bool result = true;
            SendingOptionConfig sendingOptionConfig = ConfigurationHandler.GetConfigurationSection <SendingOptionConfig>();

            this.logger.Trace("Start SendingValidation");

            if (sendingOptionConfig.SchemaValidationBool)
            {
                this.logger.Trace("Start schema");
                SchemaValidatorWithLookup schemaValidatorWithLookup = new SchemaValidatorWithLookup();
                //string document = oiosiMessage.MessageXml
                XmlDocument document = oiosiMessage.MessageXml;
                schemaValidatorWithLookup.Validate(document.OuterXml);
                result = true;
            }

            if (result && sendingOptionConfig.SchematronValidationBool)
            {
                this.logger.Trace("Start schematron");
                SchematronValidatorWithLookup schematronValidatorWithLookup = new SchematronValidatorWithLookup();
                //string document = oiosiMessage.MessageString;
                XmlDocument document = oiosiMessage.MessageXml;
                schematronValidatorWithLookup.Validate(document.OuterXml);
                result = true;
            }

            this.logger.Trace("Finish SendingValidation");
            return(result);
        }