private string GetFromFile(string fileName) { string result = string.Empty; result = Multas.ReadFile(Multas.XmlPath, fileName); return(result); }
private string GetFromFile(/*string token, string hash,*/ string fileName) { string result = string.Empty; //string serverHash; //if (Multas.TokenToHash.TryGetValue(token, out serverHash) && serverHash == hash) //{ result = Multas.ReadFile(Multas.XmlPath, fileName); //} //else //{ // result = "<XML><ERROR><DESCRIPTION>ERROR: Error de Seguridad. No se ha podido encontar el algoritmo de seguridad.Error de Seguridad. No se ha podido validar el usuario</DESCRIPTION><TYPE>E</TYPE></ERROR></XML>"; //} return(result); }
public string doOperationTAO(string xmlIn, string token) { string result = string.Empty; System.Diagnostics.Debug.WriteLine(xmlIn); XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(xmlIn); XmlNode operation = xmldoc.SelectSingleNode("//operationName"); XmlNode data = xmldoc.SelectSingleNode("//data"); XmlDocument xmlData = new XmlDocument(); xmlData.LoadXml(data.InnerText); switch (operation.InnerText) { case "Detail": { string boletin = xmlData.SelectSingleNode("//Request").InnerText; string fileName = "taoMultasDetail" + boletin + ".xml"; if (Multas.FileExists(Multas.XmlPath, fileName)) { result = GetFromFile(fileName); } else { // Pendiente - devolver estructura correcta para matricula no localizada result = GetFromFile("taoMultasInfoFromMatriculaError.xml"); } } break; case "InfoFromMatricula": { string matricula = xmlData.SelectSingleNode("//MATPROV").InnerText + xmlData.SelectSingleNode("//MATCODIGO").InnerText + xmlData.SelectSingleNode("//MATLETRA").InnerText; string fileName = "taoMultasInfoFromMatricula" + matricula + ".xml"; if (Multas.FileExists(Multas.XmlPath, fileName)) { result = GetFromFile(fileName); } else { result = GetFromFile("taoMultasInfoFromMatriculaError.xml"); } } break; case "SolicitudMatricula": { string matricula = xmlData.SelectSingleNode("//matricula").InnerText; string fileName = "taoMultasSolicitudMatricula" + matricula + ".xml"; if (Multas.FileExists(Multas.XmlPath, fileName)) { result = GetFromFile(fileName); } else { // Pendiente - devolver estructura correcta para matricula no localizada result = GetFromFile("taoMultasInfoFromMatriculaError.xml"); } } break; default: result = GetFromFile("taoMultas" + operation.InnerText + ".xml"); break; } return(result); }