Пример #1
0
        /// <summary>
        /// load the web service configuration.
        /// each wb service is identified by name. it also needs username and pwd and the name of the output file.
        /// </summary>
        /// <param name="ignoreFile"></param>
        /// <returns></returns>
        static private List <ServiceConfig> LoadServiceConfig(string serviceFile)
        {
            var Services = new List <ServiceConfig>();

            XmlDocument doc = new XmlDocument();

            doc.Load(serviceFile);
            XmlNodeList nodes = doc.SelectNodes("/services/service");
            int         i     = 0;

            foreach (XmlNode service in nodes)
            {
                var serviceConfig = new ServiceConfig
                {
                    ServiceName      = service.SelectSingleNode("name").InnerText,
                    Username         = service.SelectSingleNode("username").InnerText,
                    Password         = service.SelectSingleNode("password").InnerText,
                    ResponseFileName = service.SelectSingleNode("responseFullPathFileName").InnerText
                };

                Services.Add(serviceConfig);
                i++;
                log.InfoFormat("Service[{0}] loaded: {1}", i, serviceConfig.ToString());
            }
            return(Services);
        }
Пример #2
0
        /// <summary>
        /// load the web service configuration.
        /// each wb service is identified by name. it also needs username and pwd and the name of the output file.
        /// </summary>
        /// <param name="ignoreFile"></param>
        /// <returns></returns>
        private static List<ServiceConfig> LoadServiceConfig(string serviceFile)
        {
            var Services = new List<ServiceConfig>();

            XmlDocument doc = new XmlDocument();
            doc.Load(serviceFile);
            XmlNodeList nodes = doc.SelectNodes("/services/service");
            int i = 0;
            foreach (XmlNode service in nodes)
            {
                var serviceConfig = new ServiceConfig
                {
                    ServiceName = service.SelectSingleNode("name").InnerText,
                    Username = service.SelectSingleNode("username").InnerText,
                    Password = service.SelectSingleNode("password").InnerText,
                    ResponseFileName = service.SelectSingleNode("responseFullPathFileName").InnerText
                };

                Services.Add(serviceConfig);
                i++;
                log.InfoFormat("Service[{0}] loaded: {1}", i, serviceConfig.ToString());
            }
            return Services;
        }