Página 1 de 1

TipClient

Publicado: Mar Jun 21, 2016 7:17 pm
por Cassiano de Oliveira
Se utilizo a Classe TipClient do harbour conforme abaixo...

Código: Seleccionar todo

  Public cUrl := "http://www.receita.fazenda.gov.br/Aplicacoes/ATCTA/cpf/ConsultaPublica.asp"
      Public cUrlC:= "http://www.receita.fazenda.gov.br/Aplicacoes/ATCTA/cpf/captcha/gerarCaptcha.asp"
      Public cUrl1:= "http://www.receita.fazenda.gov.br/Aplicacoes/ATCTA/cpf/ConsultaPublicaExibir.asp"

Código: Seleccionar todo

      oInternet:= TIPClientHTTP():New(cURL1, .f.)
Da erro ao compilar...

Código: Seleccionar todo

A compilar: frmConsulta.prg...
A linkar: consulta.exe...
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0xc): undefined reference to `pcre_free'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0x66): undefined reference to `pcre_exec'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0x10c): undefined reference to `pcre_compile'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0x3a4): undefined reference to `pcre_exec'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0x565): undefined reference to `pcre_exec'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0x96c): undefined reference to `pcre_exec'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0xafc): undefined reference to `pcre_exec'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0xc6a): undefined reference to `pcre_exec'
D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o):hbregex.c:(.text+0xdcd): more undefined references to `pcre_exec' follow
D:\DEV\xailer\hb32\comp\mingw\Bin\ld: D:/DEV/xailer/hb32/Lib/Win/mingw/libhbrtl.a(hbregex.o): bad reloc address 0x4 in section `.text.startup'
1 Files, 0 Warnings, 10 Errors
Compilar tempo: 0.80s   Linkar tempo: 0.50s   Tempo total: 1.32s
Preciso utilizar o TipClient no código abaixo:

Código: Seleccionar todo

Local oUrl, oInternet, cData, cRet:= '', aRetorno, cTexto, nIni, nFim, hHeaders1, cParm

   cParm:= { { "txtTexto_captcha_serpro_gov_br", cCaptcha },;
             { "tempTxtCPF", cCpf },;
             { "tempTxtNascimento", DToC(cDataN) },;
             { "temptxtToken_captcha_serpro_gov_br", '' },;
             { "temptxtTexto_captcha_serpro_gov_br", cCaptcha }}

	hHeaders1:= HB_Hash()
	            hHeaders1["Content-Type"]:= "application/x-www-form-urlencoded"
               hHeaders1["Accept"]:= "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
     	         hHeaders1["Accept-Encoding"]:= "gzip, deflate"
     	         hHeaders1["Accept-Language"]:= "pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3"
     	         hHeaders1["Connection"]:= "keep-alive"
   Try
      oInternet:= TIPClientHTTP():New(cURL1, .f.)
   Catch
		MsgStop('Erro na Conexão','Consulta CPF')
		Return .f.
	End
   oInternet:SetCookie(cStringCookie)
   oInternet:hHeaders:= hHeaders1
	If oInternet:Open()
		If oInternet:Post(cParm)
			cRet:=oInternet:ReadAll()
      Else
      	MsgStop('Erro no Post','Consulta CPF')
      	Return .F.
		EndIf
	Else
		MsgStop('Erro na Conexão','Consulta CPF')
		Return .f.
	EndIf
	oInternet:Close()
Qual o motivo desse erro?

Re: TipClient

Publicado: Mar Jun 21, 2016 10:49 pm
por ftwein
Você tem que selecionar a hbpcre em Propriedades do Projeto / Livrarias.

Re: TipClient

Publicado: Jue Jun 23, 2016 4:43 am
por Cassiano de Oliveira
Obrigado...

Além da hbpcre também tive que adicionar libiphlpapi

Ai resolveu...

Solved

Thanks.