private Org.Sdmxsource.Sdmx.Api.Model.IStructureWorkspace extractStructureArtefact(string InvokeMethodResultDoc)
        {
            Org.Sdmxsource.Sdmx.Api.Model.IStructureWorkspace structureworkspace;
            XmlNode             soapContent;
            XmlNamespaceManager nsmgr;

            try
            {
                Estat.Sri.SdmxStructureMutableParser.Manager.StructureMutableParsingManager StructureReader = new Estat.Sri.SdmxStructureMutableParser.Manager.StructureMutableParsingManager();
                XmlDocument wsResponse = new XmlDocument();

                wsResponse.LoadXml(InvokeMethodResultDoc);
                nsmgr = CommonNamespace.StructureNamespace(wsResponse.NameTable);

                soapContent = wsResponse.SelectSingleNode("//web:GetDataStructureResponse ", nsmgr);

                if (soapContent != null)
                {
                    using (IReadableDataLocation location = new Org.Sdmxsource.Util.Io.XmlDocReadableDataLocation(soapContent))
                    {
                        structureworkspace = StructureReader.ParseStructures(location);
                        location.Close();
                    }
                }
                else
                {
                    return(null);
                }

                return(structureworkspace);
            }
            catch (Exception e)
            {
                throw new Exception("[GetDataDLL.Model.ApplicationModel.MetadataLoader.extractStructureArtefact] - " + e.Message);
            }
        }
示例#2
0
        private Org.Sdmxsource.Sdmx.Api.Model.IStructureWorkspace extractStructureArtefact(string InvokeMethodResultDoc)
        {
            Org.Sdmxsource.Sdmx.Api.Model.IStructureWorkspace structureworkspace;
            XmlNode             soapContent;
            XmlNamespaceManager nsmgr;

            try
            {
                Estat.Sri.SdmxStructureMutableParser.Manager.StructureMutableParsingManager StructureReader = new Estat.Sri.SdmxStructureMutableParser.Manager.StructureMutableParsingManager();
                XmlDocument wsResponse = new XmlDocument();

                wsResponse.LoadXml(InvokeMethodResultDoc);
                nsmgr = ApplicationSettings.classes.common.CommonNamespace.RegistryNamespace(wsResponse.NameTable);

                nsmgr.AddNamespace("message", "http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message");

                //2.0
                soapContent = wsResponse.SelectSingleNode("//message:RegistryInterface", nsmgr);

                if (soapContent == null)
                {
                    //2.1 structure (dataflow, codelist)
                    soapContent = wsResponse.SelectSingleNode("/*[local-name()='Envelope' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='Body' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/'][1]/*[local-name()='GetDataflowResponse' and namespace-uri()='http://tempuri.org/'][1]/*[local-name()='GetDataflowResult' and namespace-uri()='http://tempuri.org/'][1]/*[local-name()='Structure' and namespace-uri()='http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message'][1]");
                    if (soapContent == null)
                    {
                        //2.1 DSD
                        soapContent = wsResponse.SelectSingleNode("/*[local-name()='Envelope' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='Body' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/'][1]/*[local-name()='GetDataStructureResponse' and namespace-uri()='http://tempuri.org/'][1]/*[local-name()='GetDataStructureResult' and namespace-uri()='http://tempuri.org/'][1]/*[local-name()='Structure' and namespace-uri()='http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message'][1]");
                    }
                    //soapContent = wsResponse.SelectSingleNode("/*[local-name()='Envelope' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='Body' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/'][1]/*[local-name()='GetDataStructureResponse' and namespace-uri()='http://tempuri.org/'][1]/*[local-name()='GetDataStructureResult' and namespace-uri()='http://tempuri.org/'][1]/*[local-name()='Structure' and namespace-uri()='http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message'][1]/*[local-name()='Structures' and namespace-uri()='http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message'][1]/*[local-name()='DataStructures' and namespace-uri()='http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure'][1]");
                }

                if (soapContent != null)
                {
                    using (IReadableDataLocation location = new Org.Sdmxsource.Util.Io.XmlDocReadableDataLocation(soapContent))
                    {
                        structureworkspace = StructureReader.ParseStructures(location);
                        location.Close();
                    }
                }
                else
                {
                    return(null);
                }

                return(structureworkspace);
            }
            catch (Exception e)
            {
                throw new Exception("[GetDataDLL.Model.ApplicationModel.MetadataLoader.extractStructureArtefact] - " + e.Message);
            }
        }