I want to make a form with the access key field and the captcha code to fill in. Soon this data will be sent to the NFE portal and will return the NFE information to me. The captcha already managed to make it work on my form, I just can not send this information.
The url is this: link
Or this too: link
I think it would be something like:
DefaultHttpClient httpCliente = (DefaultHttpClient) request.getSession().getAttribute("httpClienteCnpj");
BasicClientCookie cookieFlag1 = new BasicClientCookie("flag","1");
cookieFlag1.setDomain("http://nfe.sefaz.ba.gov.br");
cookieFlag1.setPath("/");
httpCliente.getCookieStore().addCookie(cookieFlag1);
List<NameValuePair> lista = new ArrayList<NameValuePair>();
//teste
lista.add(new BasicNameValuePair("txt_cod_antirobo", receitaBean.getLetras()));
lista.add(new BasicNameValuePair("txt_chave_acesso", "43160988379771003017550010009335021009335027"));
lista.add(new BasicNameValuePair("btn_consulta_completa", "Consulta Completa"));
HttpPost post = new HttpPost("http://nfe.sefaz.ba.gov.br/servicos/nfenc/Modulos/Geral/NFENC_consulta_chave_acesso.aspx");
post.setEntity(new UrlEncodedFormEntity(lista));
HttpResponse response = httpCliente.execute(post);