Esempio n. 1
0
        private int validateXmlData(XmlDocument xdoc, MSOWebServiceCallContextDTO context)
        {
            MSOIntegrationDAO dao        = new MSOIntegrationDAO();
            string            schemaFile = Path.Combine(Pemi.Esoda.Tools.MSOIntegrationHelper.MSOProcessingHelper.MSODirectoryPath, dao.GetMSOSchemaFileName(context.DocumentGUID));

            if (string.IsNullOrEmpty(schemaFile))
            {
                return(-1); //no schemaFile
            }
            XmlValidator xv = new XmlValidator();

            try
            {
                return(xv.ValidateWithSchemaFile(xdoc.OuterXml, schemaFile) ? 1 : 0); //1 - xml valid, 0 - xml not valid
            }
            catch
            {
                return(-2); //validator error
            }
        }