Tanto o componente, quanto o Neverstop, armazenam o XML destinatário do SAT na pasta copiasegurança.
Esse XML Destinatário, é o XML usado para gerar a impressão e é o XML encaminhado para o contador no fechamento mensal.
Pode acontecer de você mesmo querer gerar esse XML ou ter a necessidade de gerar. Por isso, vamos aos passos.
Localizando o arquivo
Para gerar o XML destinatário, primeiro precisaremos do retorno autorizado do SAT. Esse arquivo de retorno, fica na pasta Log do componente CF-eSAT.
Se você usa o Neverstop, o arquivo estará em ManagerNeverStop\resources\log.
O arquivo que você precisa, tem o sufixo -ret-env.cfe.txt e o seu conteúdo deve ser semelhante a:
468790|06000|0000|Emitido com sucesso + conteúdo notas|||PENGZT48aW5mQ0ZlIElkPSJDRmUzNTE5MDIxMTExMTExMTExMTExMTU5MTIzNDU2Nzg5MDAwMDU1ODA4MzI5NSIgdmVyc2FvPSIwLjA2IiB2ZXJzYW9EYWRvc0VudD0iMC4wNyIgdmVyc2FvU0I9IjAwMDAwMyI+PGlkZT48Y1VGPjM1PC9jVUY+PGNORj44MDgzMjk8L2NORj48bW9kPjU5PC9tb2Q+PG5zZXJpZVNBVD4xMjM0NTY3ODk8L25zZXJpZVNBVD48bkNGZT4wMDAwNTU8L25DRmU+PGRFbWk+MjAxOTAyMTE8L2RFbWk+PGhFbWk+MTExMzQ5PC9oRW1pPjxjRFY+NTwvY0RWPjx0cEFtYj4yPC90cEFtYj48Q05QSj4xMTExMTExMTExMTExMTwvQ05QSj48c2lnbkFDPmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE8L3NpZ25BQz48YXNzaW5hdHVyYVFSQ09ERT5USGR1SkVCOFFo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kDLpKZjXN2YWIWNKlIhMMl+U8VYH8A5J8D8tjGgVg==
Gerando o XML
O XML Destinatário está dentro desse retorno, mas se encontra encodado em Base64. O código que está em negrito no exemplo acima, representa o XML. Basta pegar esse código e decodificar em Base64. O retorno da decodificação, será o XML Destinatário a ser armazenado.
No exemplo aqui, usamos um decodificador online para representar o processo.
Obs: O método de decodificação que será usado na sua aplicação, é externo ao componente
Comentários
1 comentário
In an era where Online Criminology Coursework Writing Services are thriving, it has become increasingly difficult for students to identify with a reliable company that offers Criminology Custom Writing Services and Criminology Assignment Writing Services .
Por favor, entre para comentar.