joemil Moderador

Registrado: Quinta-Feira, 25 de Março de 2004 Mensagens: 9100 Localização: Sinop-MT
|
Enviada: Qui Out 04, 2012 4:09 pm Assunto: ACBRNFe - Pegar dados do cliente na sefaz |
|
|
ola pessoal,
uma vez vi um topico com titulo parecido com este, mas como a pesquisa nao ta funcionando, resolvi postar aqui a solucao:
no demo do ACBRNFe, tem um button (Cons. Cadastro) q realiza esta operacao: veja copia da procedure do demo do acbrNFe (so mudei o ultimo ShowMessage pra mostrar todos os dados):
Código: | procedure TForm1.btnConsCadClick(Sender: TObject);
var
UF, Documento: string;
begin
if not (InputQuery('WebServices Consulta Cadastro ', 'UF do Documento a ser Consultado:', UF)) then
exit;
if not (InputQuery('WebServices Consulta Cadastro ', 'Documento(CPF/CNPJ)', Documento)) then
exit;
Documento := Trim(NotaUtil.LimpaNumero(Documento));
ACBrNFe1.WebServices.ConsultaCadastro.UF := UF;
if Length(Documento) > 11 then
ACBrNFe1.WebServices.ConsultaCadastro.CNPJ := Documento
else
ACBrNFe1.WebServices.ConsultaCadastro.CPF := Documento;
ACBrNFe1.WebServices.ConsultaCadastro.Executar;
MemoResp.Lines.Text := UTF8Encode(ACBrNFe1.WebServices.ConsultaCadastro.RetWS);
memoRespWS.Lines.Text := UTF8Encode(ACBrNFe1.WebServices.ConsultaCadastro.RetornoWS);
LoadXML(MemoResp, WBResposta);
ShowMessage(ACBrNFe1.WebServices.ConsultaCadastro.xMotivo);
with ACBrNFe1.WebServices.ConsultaCadastro.RetConsCad.InfCad.Items[0] do
begin
ShowMessage(xNome + #13 + xFant + #13 + xLgr + ',' + Trim(nro) + ' - ' + Trim(xCpl) + #13 + xBairro + #13 +
xMun + '-' + IntToStr(cMun) + #13 + uf + #13 + IntToStr(CEP) + #13 + CNPJ + #13 + CPF + #13 + IE + #13 + xRegApur);
end;[IMG]http://i46.tinypic.com/ix7fio.jpg[/IMG]
end;
|
e o xml q é retornado:
 _________________ <b>SEMPRE COLOQUE [RESOLVIDO] NO SEU POST</b>
Enviar imagens: http://tinypic.com/ |
|