Jump to content

dev botao

  • Este tópico foi criado há 2624 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Recommended Posts

Posted

Precisei efetuar um ajuste no fonte da unit: ACBreSocialWebServices:

Local: function TConsultaLote.TratarResposta: Boolean;

Estava gravando na o mesmo código,descrição,tipo e localização  de ocorrência para todas as instâncias da tag ocorrencia retornadas pela consulta.

Na parte que trata as ocorrências:

while reader.rExtrai(1, 'ocorrencia', '', j + 1) <> '' do
          begin
            Processamento.Ocorrencias.Add;
            Processamento.Ocorrencias.Items[j].xml := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Arquivo := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Grupo := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].LerXml;
            inc(j);
          end;

troquei por:

while Leitor.rExtrai(1, 'ocorrencia', '', j + 1) <> '' do
          begin
            Processamento.Ocorrencias.Add;
            Processamento.Ocorrencias.Items[j].xml := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Arquivo := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Grupo := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].LerXml;
            inc(j);
          end;

 

 

 

  • 2 weeks later...
Posted

Este mesmo método (Local: function TConsultaLote.TratarResposta: Boolean) tem uma outra falha de leitura. Ao ler o retorno da consulta, não estava percorrendo todos os eventos de retorno.

     (...)

      Leitor.Arquivo := FPRetWS;
      Leitor.Grupo := Leitor.rExtrai(1, 'retornoEventos');
      i:=0;
      while Leitor.rExtrai(1, 'evento', '', i + 1) <> '' do
      begin
        //recepcao
        Reader := TLeitor.Create;
        try
          Reader.Arquivo := Leitor.Grupo;
          retEvento := FRetProcLote.retEventos.Add;
          retEvento.IDEvento := Leitor.rAtributo('Id', 'evento');
          Reader.Grupo := Reader.rExtrai(1, 'recepcao');
          retEvento.FRecepcao.FtpAmb := TpTpAmb(Integer(Leitor.rCampo(tcInt, 'tpAmb')));
          retEvento.FRecepcao.FdhRecepcao :=  ISO8601ToDateTime(Leitor.rCampo(tcStr, 'dhRecepcao',''));
          retEvento.FRecepcao.FversaoAplicRecepcao := Leitor.rCampo(tcStr, 'versaoAppRecepcao');
          retEvento.FRecepcao.Fprotocolo := Leitor.rCampo(tcStr, 'protocoloEnvioLote');

    (...)

Posted

@Sandro Felipe Adad 

Neste mesmo evento que eu e vc citamos, existe outra pequena correção a se fazer. Ao transmitir dois eventos em que ambos continham erros, o componente estava associando todas as ocorrências à todos os eventos:

Citar

while reader.rExtrai(1, 'ocorrencia', '', j + 1) <> '' do
          begin
            Processamento.Ocorrencias.Add;
            Processamento.Ocorrencias.Items[j].xml := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Arquivo := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Grupo := Leitor.Grupo;
            Processamento.Ocorrencias.Items[j].LerXml;
            inc(j);
          end;

troquei por:

while reader.Extrai(1, 'ocorrencia', '', j + 1) <> '' do
          begin
            Processamento.Ocorrencias.Add;
            Processamento.Ocorrencias.Items[j].xml := reader.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Arquivo := reader.Grupo;
            Processamento.Ocorrencias.Items[j].FLeitor.Grupo := reader.Grupo;
            Processamento.Ocorrencias.Items[j].LerXml;
            inc(j);
          end;

Desta forma cada retEvento terá suas ocorrências referenciadas. Segue exemplo do arquivo de retorno que utilizei como exemplo para identificar o problema.

 

RespConsulta_Soap.xml

  • Este tópico foi criado há 2624 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

The popup will be closed in 10 seconds...