Example #1
0
        public void TestSimpleJson()
        {
            String cResult = RestJSON.SendJsonSimple("https://192.168.0.145/login.fcgi", "{\"login\":\"admin\",\"password\":\"admin\"}");

            Console.WriteLine(cResult);
            Assert.IsTrue(cResult.Contains("session"), "Erro ao fazer o login");
        }
Example #2
0
        public void Usuario_SaveTemplate()
        {
            if (rep.iDClassSession == null)
            {
                Assert.Inconclusive("iDClass não conectado");
            }

            //UserUpdateRequest uur = new UserUpdateRequest();
            UserAddRequest uur = new UserAddRequest();

            uur.Usuario[0].PIS  = 444;
            uur.Usuario[0].Nome = "Fabio 2";
            // Digital TXAI indicador direito
            //uur.Usuario[0].Templates = new string[] { "SUNSUzIxAAAMbAMBAAAAAMUAxQDwAJABAAAAhBIfXwAUAHwPrAA1AJcPSAA2AG4PfQA/ABQPogBeAJkPxgBjACUPhgBoAB0PewB2AIQPbgB9ABYPyACRACoPrgChAKkPDQCxAFUPowCyAKYPVwDbAPsP4wDmAKcPFgD2ANYPiQD/AKoPtwAUAaUPQQAVAdwPfAAZAYsOogAaAaIPygAlAZYPlQArAY8POQA3AVAOyAA9AY0PtgBCAYcPSQBTAfUP3QBbAYQPqwBeAXkPKwBvAe0PVAB3AXIPXhIvaRfnNgNjhBd17vYbXi9TpvtnfIt8WnzudbIH4o2b/AuRwZlWhMYIaXDZaefsVZRO+Fd/woAXBLuFMQXCgKuHZ4NDXxtDsf2/fYcno1PXI/cnOwcrE3cDx/1ng5/fKSP6CQ8cUQb5EkYa7o0/CatTyeMS/PrqORXV/oL5LQqJ8kYRze2OBAoKXlz6dX9naQm5+h4J8f1KENLxNqTChu4KpvmX/HsN2vTm7wf1dvqef1+fxn6Wh78n5dwnOSA8AQKUJNEMAIIBDDg4aP8JAJoBEP//wDbABwCvARP/OP8NAHIFCUA+wUP+EwAtEPRG+8HAQf/AwFhGBgBbEYOJwQcAYxQJS00HAFsXesB3wgcARDV0g2gRAEw2+i/+//5AwGJHCABHOm1pag4AgkATMFTBwf///8AXAAVK3P/+MEb9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jVOwcTGxcLBwcDAwf7BVAUQbhd9xmwYEMcokP/+/U+AxsjCwsDAwf//wf/AxAwQkSqQm8Q3wlkDEMs/DP8XEOk/k21HNv/AysjAwcH9wMP8wBAQw0CJ/2rAxIRifA8QskKJaXXCWMLCwQ0QUFH3V//A/sP+/1UOENhYicL+fsL+c5QNEKRbfWhpcJcEEKxe/T4LEKVidET/wcFqERDtZ4PCUm3+wcDB/sJKDBDocoB7ZFv/BhDqfn3AcwMQ34p9wQBEQgEBAAAAFgAAAAACBQAAAAAAAEVC" };
            // Digital Fabio indicaro direito


            string template_iDX     = "SUNSUzIxAAAJwgMBAAAAAMUAxQDvADoBAAAAg0gUtgAWAJQPrwAhAJEPlABSAIwP0wBWABwPlQBcABcP4QB0AJ0PggCUAHsP5ACWABkOtgClACkPkgDDAJMPggDMAGcOQgDrAGAPqgD6AKYPeAD+AO0OogAIAZ8PbAAQAfcOmgATAYgPnwAfAYUMNAAnAekPugAoAYwORAdDCx97yP9HBht3MHfL/vtzloDjB+uTJI+7n2f/koAihUN3O+kTVkcWJn3f8B//v5hPEOeyWS3TbKMZBdVjfdvuP2ovdmt7MQgyICYi7fqqZp5TPRi5+CkeYQ6PcJd1KAfR6NLkrP/B6gn7i/dji4P/gQuOBpru19wMIDgBAk8eKgMAswYXwQYAbw2DwVwDAIgVDP4DAM4iGsAJAB4i8P/+U/3/CQCMIA9YQ8EFALMkEDgFACIq+l0NAFwgAC9LVmwTABo78MA+Nv1KRlQSAA9N6cD9wTVBRP9UDACQTYzAkHfAgwwAkFOJwMGQfowJAJhTEEDAWQ0AkFuMwcLAlMLAwnEIAJhbEP7AN8EUAA1c4jU4/sD+N/9EZAkAl2AXVFX/DAB+kYanwcB7wP4MAIaWFjFTwmsNAH6XgMPEwH7AwEMHALinKcDAaxgAB6nQwCrB/cL+/f///v3AwP//wMDAwP8IAI/AnMTGxcFcGQADwtBF/UD/wfz///3+wP/+wf/B/sL/CwB+yHfGwsD//1P+GQAJys9GQP/AKv7+///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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
            string template_iDClass = RepCid.TemplateToiDClass(Convert.FromBase64String(template_iDX));

            uur.Usuario[0].Templates = new string[] { template_iDClass };

            StatusResult st = (StatusResult)RestJSON.SendJson(rep.IP, uur, typeof(StatusResult), rep.iDClassSession);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Example #3
0
        public void Usuario_ChangePIS()
        {
            UserUpdateRequest uur = new UserUpdateRequest();

            uur.Usuario[0].PIS  = 108;
            uur.Usuario[0].PIS2 = 223344;
            uur.Usuario[0].Nome = "Teste Change PIS (com template)";

            StatusResult st = (StatusResult)RestJSON.SendJson(rep.IP, uur, typeof(StatusResult), rep.iDClassSession);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Example #4
0
        public void Usuario_ChangePIS()
        {
            UserUpdateRequest uur = new UserUpdateRequest();

            uur.Usuario[0].PIS  = 108;
            uur.Usuario[0].PIS2 = 223344;
            uur.Usuario[0].Nome = "Teste Change PIS (com template)";

            StatusResult st = RestJSON.SendJson <StatusResult>(Config.repIP, uur, session);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Example #5
0
        public void TestParseResult()
        {
            string html = @"HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: origin, x-csrftoken, content-type, accept
Vary: Origin
Allow: GET, HEAD
Content-Type: application/json; charset=utf-8
Content-Length: 90

{""mac"":""02:31:37:26:32:45"",""nSerie"":""00014000010000001"",""versionFW"":536,""versionMRP"":1048}";

            AboutResult ar = RestJSON.JsonFrom <AboutResult>(Encoding.UTF8.GetBytes(html));

            Console.WriteLine(string.Format("Serie: {0} FW: {1} MRP: {2}", ar.NumeroSerie, ar.VersionFW, ar.VersionMRP));
        }
Example #6
0
        public void Usuario_SaveTemplate()
        {
            //UserUpdateRequest uur = new UserUpdateRequest();
            UserAddRequest uur = new UserAddRequest();

            uur.Usuario[0].PIS  = 108;
            uur.Usuario[0].Nome = "Teste Add Modify Template";
            // Digital TXAI indicador direito
            uur.Usuario[0].Templates = new string[] { "SUNSUzIxAAAMbAMBAAAAAMUAxQDwAJABAAAAhBIfXwAUAHwPrAA1AJcPSAA2AG4PfQA/ABQPogBeAJkPxgBjACUPhgBoAB0PewB2AIQPbgB9ABYPyACRACoPrgChAKkPDQCxAFUPowCyAKYPVwDbAPsP4wDmAKcPFgD2ANYPiQD/AKoPtwAUAaUPQQAVAdwPfAAZAYsOogAaAaIPygAlAZYPlQArAY8POQA3AVAOyAA9AY0PtgBCAYcPSQBTAfUP3QBbAYQPqwBeAXkPKwBvAe0PVAB3AXIPXhIvaRfnNgNjhBd17vYbXi9TpvtnfIt8WnzudbIH4o2b/AuRwZlWhMYIaXDZaefsVZRO+Fd/woAXBLuFMQXCgKuHZ4NDXxtDsf2/fYcno1PXI/cnOwcrE3cDx/1ng5/fKSP6CQ8cUQb5EkYa7o0/CatTyeMS/PrqORXV/oL5LQqJ8kYRze2OBAoKXlz6dX9naQm5+h4J8f1KENLxNqTChu4KpvmX/HsN2vTm7wf1dvqef1+fx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QAnq+nwcHCwcTExMH/w2TAwMFsCgCltS1S/4nABgBb2O35+UEEAGTyWlUaABXz0EzB/kb9+/z//jtccYQZABr218DAU//+JjP+wFl4kAMAE/tWwAoAZ/5W/VlHwQkAbf4nwsDC/8NZDgCG/6T/wcjGxMDCPlsYELcQpP83wMDDmsPCwcB7Ul8WELQWnjVOwcTGxcLBwcDAwf7BVAUQbhd9xmwYEMcokP/+/U+AxsjCwsDAwf//wf/AxAwQkSqQm8Q3wlkDEMs/DP8XEOk/k21HNv/AysjAwcH9wMP8wBAQw0CJ/2rAxIRifA8QskKJaXXCWMLCwQ0QUFH3V//A/sP+/1UOENhYicL+fsL+c5QNEKRbfWhpcJcEEKxe/T4LEKVidET/wcFqERDtZ4PCUm3+wcDB/sJKDBDocoB7ZFv/BhDqfn3AcwMQ34p9wQBEQgEBAAAAFgAAAAACBQAAAAAAAEVC" };

            StatusResult st = (StatusResult)RestJSON.SendJson(rep.IP, uur, typeof(StatusResult), rep.iDClassSession);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Example #7
0
        public void Usuario_SaveTemplate()
        {
            UserAddRequest uur = new UserAddRequest();

            uur.Usuario[0].PIS  = (ulong)Config.pisTEST;
            uur.Usuario[0].Nome = "Fabio Teste";
            string template_iDX     = "SUNSUzIxAAAJwgMBAAAAAMUAxQDvADoBAAAAg0gUtgAWAJQPrwAhAJEPlABSAIwP0wBWABwPlQBcABcP4QB0AJ0PggCUAHsP5ACWABkOtgClACkPkgDDAJMPggDMAGcOQgDrAGAPqgD6AKYPeAD+AO0OogAIAZ8PbAAQAfcOmgATAYgPnwAfAYUMNAAnAekPugAoAYwORAdDCx97yP9HBht3MHfL/vtzloDjB+uTJI+7n2f/koAihUN3O+kTVkcWJn3f8B//v5hPEOeyWS3TbKMZBdVjfdvuP2ovdmt7MQgyICYi7fqqZp5TPRi5+CkeYQ6PcJd1KAfR6NLkrP/B6gn7i/dji4P/gQuOBpru19wMIDgBAk8eKgMAswYXwQ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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
            string template_iDClass = RepCid.TemplateToiDClass(Convert.FromBase64String(template_iDX));

            uur.Usuario[0].Templates = new string[] { template_iDClass };

            StatusResult st = RestJSON.SendJson <StatusResult>(Config.repIP, uur, session);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Example #8
0
        public void Conectar()
        {
            // É possivel se comunicar diretamente com REP iDClass via chamadas JSON
            ConnectRequest login = new ConnectRequest()
            {
                Login    = Config.repLogin,
                Password = Config.repSenha
            };

            ConnectResult cn = RestJSON.SendJson <ConnectResult>(Config.repIP, login);

            if (cn.isOK)
            {
                session = cn.Session;
            }
            else
            {
                Assert.Inconclusive(cn.Status);
            }
        }
Example #9
0
        public void Usuario_JSON()
        {
            // Exemplo de criação de um usuário
            User usr = new User()
            {
                PIS       = (ulong)(Config.pisTEST * 2),
                Nome      = "Usuario via JSON Adicionado",
                Matricula = 33467L,
                Codigo    = 234, // código para login via teclado
                Senha     = "567",
                RfId      = 8899,
                Barras    = "12345",
                Admin     = false
            };

            // Solicita a inclusão deste usuário
            StatusResult st = RestJSON.SendJson <StatusResult>(Config.repIP, new UserAddRequest(usr), session);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }

            // Lembrando que toda alteração cadastral fica sempre gravada no AFD
            usr.Nome = "Nome alterado via JSON";
            st       = RestJSON.SendJson <StatusResult>(Config.repIP, new UserUpdateRequest(usr), session);
            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }

            // mesmo apagando é possivel ver a alteração no AFD
            st = RestJSON.SendJson <StatusResult>(Config.repIP, new UserDeleteRequest(usr.PIS), session);
            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Example #10
0
        public void Empregador_JSON()
        {
            // Exemplo de criação de um usuário
            Company emp = new Company()
            {
                RazaoSocial   = "Teste de Empregador",
                Documento     = 12345678000123,
                DocumentoTipo = 1,
                Endereco      = "Rua de qualquer lugar, bairro, cidade",
                CEI           = 12345678,
                CPF           = 1212312345
            };

            // Solicita a alteração do empregador
            StatusResult st = RestJSON.SendJson <StatusResult>(Config.repIP, new EmpregadorRequest(emp), session);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }

            // Solicita a alteração do empregador
            EmpregadorResult empResult = RestJSON.SendJson <EmpregadorResult>(Config.repIP, "load_company", session);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }

            Console.WriteLine(empResult.Empresa.RazaoSocial);
            Console.WriteLine(empResult.Empresa.Documento);
            Console.WriteLine(empResult.Empresa.DocumentoTipo);
            Console.WriteLine(empResult.Empresa.Endereco);
            Console.WriteLine(empResult.Empresa.CEI);
            Console.WriteLine(empResult.Empresa.CPF);
        }
Example #11
0
        public void ListAll()
        {
            try
            {
                // Para simplificar os dados de login serão os mesmos, o que mudará logico será o IP do REP!
                ConnectRequest login = new ConnectRequest()
                {
                    Login    = "******",
                    Password = "******"
                };

                // Conecta-se com o primeiro REP
                var REP1 = "192.168.0.19";
                var cn1  = RestJSON.SendJson <ConnectResult>(REP1, login); // Origem
                if (!cn1.isOK)
                {
                    Assert.Inconclusive(REP1 + ": " + cn1.Status);
                }

                Console.WriteLine("REP1 Conectado");

                // Lista todos os usuários em blocos de 10
                var uReq = new UserRequest()
                {
                    Limit = 10
                };                                           // sem o template
                // É necessário paginar por diversos motivos, principalmente quando o número de usuários é grande, e usa-se biometria
                // Paginando é possivel fazer barras de progresso, deixando o sistema mais amigavel, sem isso a rotina fica travada até ser feita toda a comunicação
                // Também há limites do empactamento JSON de 2MB, e de limite de memória interna no REP, pois os templates em geral são grandes
                // Ao listar usuários sem templates não há problemas de pegar tudo em único comando, mas quando se usa biometria ai tem que paginar mesmo.
                int nTotal = 0;
                do
                {
                    var userBlock = RestJSON.SendJson <UserResult>(REP1, uReq, cn1.Session);
                    if (!userBlock.isOK)
                    {
                        Assert.Fail(REP1 + ": " + userBlock.Status);
                    }

                    // Totaliza e verifica se terminou
                    nTotal += userBlock.ListUsers.Length;
                    if (nTotal >= userBlock.TotalUsers || userBlock.ListUsers.Length == 0)
                    {
                        break;
                    }

                    foreach (var user in userBlock.ListUsers)
                    {
                        Console.WriteLine(user.PIS + ": " + user.Nome + " - " + user.Barras + " - " + user.RfId + " - " + user.TemplatesCount);
                    }
                    // O numero de templates é informado, mas não foi carregado no request!

                    // Proximó bloco de registros
                    uReq.Offset += uReq.Limit;
                } while (true);
            }
            catch (Exception ex)
            {
                // Erro desconhecido (qualquer erro que não vier do REP, incluindo erros de rede ou comunicação)
                Assert.Fail(ex.Message);
            }
        }
Example #12
0
        public void CopyAll()
        {
            try
            {
                // Para simplificar os dados de login serão os mesmos, o que mudará logico será o IP do REP!
                ConnectRequest login = new ConnectRequest()
                {
                    Login    = "******",
                    Password = "******"
                };

                // Conecta-se com o primeiro REP
                var REP1 = "192.168.0.19";
                var cn1  = RestJSON.SendJson <ConnectResult>(REP1, login); // Origem
                if (!cn1.isOK)
                {
                    Assert.Inconclusive(REP1 + ": " + cn1.Status);
                }

                Console.WriteLine("REP1 Conectado");

                // Conecta-se com o segundo REP
                var REP2 = "192.168.2.105";
                var cn2  = RestJSON.SendJson <ConnectResult>(REP2, login); // Destino
                if (!cn2.isOK)
                {
                    Assert.Inconclusive(REP2 + ": " + cn2.Status);
                }

                Console.WriteLine("REP2 Conectado");

                // Este comando requisita somente os 10 primeiros registros (apenas para evitar erros de comunicação quando há muitos dados)
                // para simplificar este exemplo não será feito nenhum loop ou tratamento, isso será abordado no exemplo seguinte
                // Estando ambos os REP Conectados, primeiro lê todos os usuários do REP1, já com os templates em um único comando
                var userBlock = RestJSON.SendJson <UserResult>(REP1, new UserRequest()
                {
                    Limit = 10, Templates = true
                }, cn2.Session);
                if (!userBlock.isOK)
                {
                    Assert.Fail(REP1 + ": " + userBlock.Status);
                }

                Console.WriteLine("REP1 Lido " + userBlock.ListUsers.Length + " usuários");

                // É gerado um arquivo "log-RepCID-iDClass.txt" na pasta onde fica a DLL que contem toda a comunicação
                // Mas é possivel desabilitar o log de comunicação, por padrão vem habilitado por ser é bem util no desenvolvimento ou para encontrar problemas
                // RestJSON.WriteLog = false;
                // Evite manter isso ligado em produção para não acabar com o espaço em disco, pois esse log fica realmente muito grande
                // RestJSON.TimeOut = 30000;
                // É possivel também reconfigurar o timeout padrão das requisição

                // ATENÇÃO: por segurança só existe substituição de dados quando isso é feita de forma explicita!
                // Portanto os comandos de INSERT e UPDATE são distintos, e cada um tem validações específicas
                // var insertRequest = new UserAddRequest() { Usuario = userBlock.ListUsers }; // Não é possivel inserir pessoas com o mesmo PIS
                var modifyRequest = new UserUpdateRequest()
                {
                    Usuario = userBlock.ListUsers
                };                                                                             // Não é possivel alterar pessoas que não existem (baseado no PIS, que é sempre o identificador único)

                var result = RestJSON.SendJson <StatusResult>(REP2, modifyRequest, cn2.Session);
                if (result.isOK)
                {
                    Console.Write(result.Status);
                }
                else
                {
                    Assert.Inconclusive(result.Status);
                }
            }
            catch (Exception ex)
            {
                // Erro desconhecido (qualquer erro que não vier do REP, incluindo erros de rede ou comunicação)
                Assert.Fail(ex.Message);
            }
        }