Esempio n. 1
0
        private static DataValidations IsMneRequestValid(string message)
        {
            var thirdPartyDataActivityManagementRequest = FdrCommon.SelectNode(message, "pnsb", "http://www.sars.gov.za/enterpriseMessagingModel/ThirdPartyData/ThirdPartyDataActivityManagement/xml/schemas/version/1.1",
                                                                               "ThirdPartyDataActivityManagementRequest");

            var validations = new DataValidations(thirdPartyDataActivityManagementRequest)
            {
                SchemaList = new List <InternalSchemaData>()
            };

            var sarsgmdBasetypes               = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "MNE", "SARSGMD_BaseTypes.xsd"));
            var sarsThirdPartyDataActivity     = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "MNE", "SARSThirdPartyDataActivityManagement.xsd"));
            var sarsthirdpartysubmissionheader = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "MNE", "SARSThirdPartySubmissionHeader.xsd"));

            validations.SchemaList.AddRange(
                new List <InternalSchemaData>
            {
                new InternalSchemaData {
                    TargetNamespace = "http://www.sars.gov.za/enterpriseMessagingModel/GMD/BaseTypes/xml/schemas/version/55.2", SchemaContent = sarsgmdBasetypes
                },
                new InternalSchemaData {
                    TargetNamespace = "http://www.sars.gov.za/enterpriseMessagingModel/ThirdPartyData/ThirdPartyDataActivityManagement/xml/schemas/version/1.1", SchemaContent = sarsThirdPartyDataActivity
                },
                new InternalSchemaData {
                    TargetNamespace = "http://www.sars.gov.za/enterpriseMessagingModel/ThirdPartySubmissionHeader/xml/schemas/version/1.17", SchemaContent = sarsthirdpartysubmissionheader
                }
            }
                );
            validations.ValidateSchema();
            return(validations);
        }
Esempio n. 2
0
        private static DataValidations IsMasterLocalFileRequestValid(string message)
        {
            var contentManagementRequest = FdrCommon.SelectNode(message, "ContMgt", "http://www.sars.gov.za/enterpriseMessagingModel/ContentManagement/xml/schemas/version/1.8", "ContentManagementRequest");

            var validations = new DataValidations(contentManagementRequest)
            {
                SchemaList = new List <InternalSchemaData>()
            };

            var contMgt           = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "ML", "SARSContentManagement.xsd"));
            var sarsgmdFbasetypes = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "ML", "SARSGMD_BaseTypes.xsd"));

            validations.SchemaList.AddRange(
                new List <InternalSchemaData>
            {
                new InternalSchemaData {
                    TargetNamespace = "http://www.sars.gov.za/enterpriseMessagingModel/ContentManagement/xml/schemas/version/1.8", SchemaContent = contMgt
                },
                new InternalSchemaData {
                    TargetNamespace = "http://www.sars.gov.za/enterpriseMessagingModel/GMD/BaseTypes/xml/schemas/version/54.8", SchemaContent = sarsgmdFbasetypes
                }
            }
                );

            validations.ValidateSchema();
            return(validations);
        }
Esempio n. 3
0
        private static DataValidations IsCbcValid(string message)
        {
            var submitCountryByCountryDeclarationRequest = FdrCommon.SelectNode(message, "tnsf",
                                                                                "http://www.sars.gov.za/enterpriseMessagingModel/ThirdPartyData/SubmitCountryByCountryDeclaration/xml/schemas/version/1.2",
                                                                                "SubmitCountryByCountryDeclarationRequest");

            var validations = new DataValidations(submitCountryByCountryDeclarationRequest)
            {
                SchemaList = new List <InternalSchemaData>()
            };

            var cbcSchema   = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "CBC", "CbcXML.xsd"));
            var isocbctypes = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "CBC", "isocbctypes.xsd"));
            var declaration =
                File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "CBC", "SARSCountryByCountryDeclaration.xsd"));
            var oecdtypes        = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "CBC", "oecdtypes.xsd"));
            var sarsgmdBase      = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "CBC", "SARSGMD_BaseTypes.xsd"));
            var sarsgmdFormtypes = File.ReadAllText(string.Format(AppConfig.SchemBaseFolder, "CBC", "SARSGMD_FormTypes.xsd"));

            validations.SchemaList.AddRange(
                new List <InternalSchemaData>
            {
                new InternalSchemaData {
                    TargetNamespace = "urn:oecd:ties:cbc:v1", SchemaContent = cbcSchema
                },
                new InternalSchemaData {
                    TargetNamespace = "urn:oecd:ties:isocbctypes:v1", SchemaContent = isocbctypes
                },
                new InternalSchemaData
                {
                    TargetNamespace =
                        "http://www.sars.gov.za/enterpriseMessagingModel/ThirdPartyData/CountryByCountryDeclaration/xml/schemas/version/1.2",
                    SchemaContent = declaration
                },
                new InternalSchemaData {
                    TargetNamespace = "urn:oecd:ties:stf:v4", SchemaContent = oecdtypes
                },
                new InternalSchemaData
                {
                    TargetNamespace =
                        "http://www.sars.gov.za/enterpriseMessagingModel/GMD/BaseTypes/xml/schemas/version/55.2",
                    SchemaContent = sarsgmdBase
                },
                new InternalSchemaData
                {
                    TargetNamespace =
                        "http://www.sars.gov.za/enterpriseMessagingModel/GMD/FormTypes/xml/schemas/version/1.6",
                    SchemaContent = sarsgmdFormtypes
                }
            }
                );

            validations.ValidateSchema();
            return(validations);
        }