Ejemplo n.º 1
0
        private void UpdateToSos(string interno, string codigo, int estadoServicio, string diagnostico)
        {
            if (WebServiceSos == null)
            {
                WebServiceSos = new WebServiceSos.Service();
            }
            var res = WebServiceSos.ActualizarSvc(interno, codigo, estadoServicio, diagnostico.Split('-')[0]);

            Logger.Info("Webservice response: " + res);
        }
Ejemplo n.º 2
0
        public void CheckServices()
        {
            if (WebServiceSos == null)
            {
                WebServiceSos = new WebServiceSos.Service();
            }

            Logger.Info("Searching for a new alarm in S.O.S. service...");

            //var rollback = WebServiceSos._alertasRollback("20160217304249");

            var response = WebServiceSos.ObtenerAlertas();

            //var fecha = DateTime.Now;
            //var response = string.Format("2015{0}{1}10{1}{2},1271,IAZ 581,CITROEN C 4 2.0 I BVA EXCLUSIV,NORMAL,290.4,SOBRE MANO DERECHA FRENTE CONCESIONARIA,SAN MARTIN  500,CORDOBA,COLON   1000,CORDOBA,PALACIO HEREDIA FERNANDO JAVIE,20,CORREA DE DISTRIBUCION,AMARILLO,TRASLADO,{1}/{0}/2015 {2}:{3},-31.3241410993924,-63.9724202099609,-31.3101359203789,-63.8783077646484,1", fecha.Month, fecha.Day, fecha.Hour, fecha.Minute);
            //response += string.Format("#2015{0}{1}10{1}{2},7611,IAZ 581,CITROEN C 4 2.0 I BVA EXCLUSIV,NORMAL,290.4,SOBRE MANO DERECHA FRENTE CONCESIONARIA,SAN MARTIN  500,CORDOBA,COLON   1000,CORDOBA,PALACIO HEREDIA FERNANDO JAVIE,CORREA DE DISTRIBUCION,AMARILLO,TRASLADO,{1}/{0}/2015 {2}:{3},-31.3241410993924,-63.9724202099609,-31.3101359203789,-63.8783077646484,5", fecha.Month, fecha.Day, fecha.Hour, fecha.Minute);

            if (response != "")
            {
                Logger.DebugFormat("WebService response: {0}", response);

                var alerts = response.Split('#');
                Logger.InfoFormat("Found {0} services", alerts.Length - 1);

                foreach (var alert in alerts)
                {
                    if (alert == "")
                    {
                        continue;
                    }

                    var novelty = TranslateFrameToClass.ParseFrame(alert);
                    ServiceMessageQueueTemplate.ConvertAndSend(novelty);
                }
            }
        }