public SyncFeed2Service() { try { try { path = ConfigurationManager.AppSettings["ConfigDirectory"] != null ? ConfigurationManager.AppSettings["ConfigDirectory"].ToString() : ""; } catch (Exception ePath) { path = ""; Log.EscribeLog("Error al obtener el path desde appSettings: " + ePath.Message); } if (File.Exists(path + "info.xml")) { _conf = XMLConfigurator.getXMLfile(); id_Servicio = _conf.id_Sitio; AETitle = _conf.vchAETitle; vchPathRep = _conf.vchPathLocal; vchClaveSitio = _conf.vchClaveSitio; } cargaServicio(); } catch (Exception eSync) { Log.EscribeLog("Existe un error en SyncFeed2Service: " + eSync.Message); } }
public static bool setConfiguracionClienteXML(Feed2Service.clsConfiguracion _config, ref string mensaje) { bool valido = false; try { XmlDocument doc = new XmlDocument(); doc.Load(path + "info.xml"); XmlNode node = doc.DocumentElement.SelectSingleNode("/Configuraciones/sitio"); //Sitio node["id_Sitio"].InnerText = _config.id_Sitio.ToString(); node["claveSitio"].InnerText = _config.vchClaveSitio; node["claveSitio"].InnerText = _config.vchClaveSitio; node["NombreSitio"].InnerText = _config.vchNombreSitio; node["AETitle"].InnerText = _config.vchAETitle; node["vchPathLocal"].InnerText = _config.vchPathLocal; node["Activo"].InnerText = "1"; XmlNode nodeL = doc.DocumentElement.SelectSingleNode("/Configuraciones/sitio/hostLocal"); nodeL["ip"].InnerText = _config.vchIPCliente; nodeL["mask"].InnerText = _config.vchMaskCliente; nodeL["puerto"].InnerText = _config.intPuertoCliente.ToString(); doc.Save(path + "info.xml"); valido = true; } catch (Exception esC) { valido = false; mensaje = esC.Message; Log.EscribeLog("Existe un error al actualizar los datos de configuración. " + esC.Message); } return(valido); }
public ClienteF2CResponse updateConfiguracion(Feed2Service.clsConfiguracion mdlConfig, ref string mensaje) { ClienteF2CResponse response = new ClienteF2CResponse(); ClienteF2CRequest request = new ClienteF2CRequest(); try { request.mdlConfiguracion = mdlConfig; request.id_Sitio = mdlConfig.id_Sitio; //request.id_SitioSpecified = true; request.vchClaveSitio = mdlConfig.vchClaveSitio; request.Token = Security.Encrypt(mdlConfig.id_Sitio + "|" + mdlConfig.vchClaveSitio); response = NapoleonDA.updateConfiguracion(request); mensaje = response.message; } catch (Exception esC) { Log.EscribeLog("Existe un error al guardar la información: " + esC.Message); response.valido = false; mensaje = esC.Message; } return(response); }
public static bool setConfiguracionServerXML(Feed2Service.clsConfiguracion _config, ref string mensaje) { bool valido = false; try { XmlDocument doc = new XmlDocument(); doc.Load(path + "info.xml"); //Server XmlNode nodeS = doc.DocumentElement.SelectSingleNode("/Configuraciones/sitio/hostServer"); nodeS["ip"].InnerText = _config.vchIPServidor; nodeS["puerto"].InnerText = _config.intPuertoServer.ToString(); nodeS["AETitleServer"].InnerText = _config.vchAETitleServer; doc.Save(path + "info.xml"); valido = true; } catch (Exception esC) { valido = false; mensaje = esC.Message; Log.EscribeLog("Existe un error al actualizar los datos de configuración. " + esC.Message); } return(valido); }