Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error on deserialize json

raphael_almeida
Active Contributor
0 Likes
2,044

Hi experts !

I'm developing a webservice communication with external product and SAP. I send data to him sucessful, but when i call the response, this not deserialize.

This webservice works with JSON and his response (not deserialized is: {"retorno":{"ids":[600,608],"rpss":[{"nota":{"aliquotaServicos":0.10,"tipoRps":"1","codCidade":"4209102","idProcessamentoLote":null,"numeroProtocolo":null,"status":100,"numeroNfe":4,"situacaoRps":"1","siafiPrestador":"8179","serieRps":"NF","tipoAmbienteSistema":2,"docNum":null,"descricaoStatus":"Erro Geral no E-mail, não foi possível enviá-lo null","dataEmissaoRps":"2012-08-07T09:28:07","numeroLote":null,"valorDeduzir":0.00,"codigoVerificacao":"49BI6IB2","cnpjPrestador":"00910509000171","urlConsulta":null,"valorServicos":500.00,"inscricaoPrestador":"12345678","idProcessamentoRps":600,"numeroRps":4},"referencia":"arquivo_integrador_20120807111309.txt"},{"nota":{"aliquotaServicos":0.10,"tipoRps":"1","codCidade":"4209102","idProcessamentoLote":null,"numeroProtocolo":null,"status":100,"numeroNfe":2,"situacaoRps":"1","siafiPrestador":"8179","serieRps":"NF","tipoAmbienteSistema":2,"docNum":null,"descricaoStatus":"Autorizado o uso da NFS-e","dataEmissaoRps":"2012-08-07T09:28:07","numeroLote":null,"valorDeduzir":0.00,"codigoVerificacao":"49BI6IB2","cnpjPrestador":"00910509000171","urlConsulta":null,"valorServicos":500.00,"inscricaoPrestador":"12345678","idProcessamentoRps":608,"numeroRps":6},"referencia":"arquivo_integrador_20120807152107.txt"}]}} )

Can i put this response into itab?

I'm using 2 custom classes of CL_TREX_JSON_SERIALIZER and CL_TREX_JSON_DESERIALIZER.

Thanks,

1 ACCEPTED SOLUTION
Read only

custodio_deoliveira
Active Contributor
0 Likes
1,572

Hi Raphael,

Yes, you can have this json string in your internal table. I'd suggest you not to use these classes. Instead, use the se38/zJSON · GitHub class by

Cheers,

Custodio

4 REPLIES 4
Read only

custodio_deoliveira
Active Contributor
0 Likes
1,573

Hi Raphael,

Yes, you can have this json string in your internal table. I'd suggest you not to use these classes. Instead, use the se38/zJSON · GitHub class by

Cheers,

Custodio

Read only

0 Likes
1,572

Hi Custodio !

I import the nugget file but this error occurs:

How to resolve?

Regards,

Read only

0 Likes
1,572

It appears some plugins are missing.

Have a look at this link.

SAPlink plugin list

It would be better to install latest version of SAPLink from above link that would have all available plugins.

Read only

0 Likes
1,572

Thanks Custodio and Manish !

I still have problems with deseralizer using zjson.

Follow again my json code :

{"retorno":{"ids":[600,608],"rpss":[{"nota":{"aliquotaServicos":0.10,"tipoRps":"1","codCidade":"4209102","idProcessamentoLote":null,"numeroProtocolo":null,"status":100,"numeroNfe":4,"situacaoRps":"1","siafiPrestador":"8179","serieRps":"NF","tipoAmbienteSistema":2,"docNum":null,"descricaoStatus":"Erro Geral no E-mail, não foi possível enviá-lo null","dataEmissaoRps":"2012-08-07T09:28:07","numeroLote":null,"valorDeduzir":0.00,"codigoVerificacao":"49BI6IB2","cnpjPrestador":"00910509000171","urlConsulta":null,"valorServicos":500.00,"inscricaoPrestador":"12345678","idProcessamentoRps":600,"numeroRps":4},"referencia":"arquivo_integrador_20120807111309.txt"},{"nota":{"aliquotaServicos":0.10,"tipoRps":"1","codCidade":"4209102","idProcessamentoLote":null,"numeroProtocolo":null,"status":100,"numeroNfe":2,"situacaoRps":"1","siafiPrestador":"8179","serieRps":"NF","tipoAmbienteSistema":2,"docNum":null,"descricaoStatus":"Autorizado o uso da NFS-e","dataEmissaoRps":"2012-08-07T09:28:07","numeroLote":null,"valorDeduzir":0.00,"codigoVerificacao":"49BI6IB2","cnpjPrestador":"00910509000171","urlConsulta":null,"valorServicos":500.00,"inscricaoPrestador":"12345678","idProcessamentoRps":608,"numeroRps":6},"referencia":"arquivo_integrador_20120807152107.txt"}]}}

I want to create itab with columns and data by tag "nota".

Thanks again for helping.