1
Good morning,
I am carrying out the development of an application that carried out the generation and the sending of GNRE guides to the state of Rio de Janeiro. I have already done the development for the national environment and is working, but the state of RJ is not integrated with the national environment.
I’m following the documentation available on the state website. http://www.fazenda.rj.gov.br/sefaz/faces/oracle/webcenter/portalapp/pages/navigation-renderer.jspx?_afrLoop=167210291667000&datasource=Ucmserver%23dDocName%3A3380027&_adf.Ctrl-state=nymmlq023_36
I am making use for communication with the webservice component Tidhttp and am having the following problem.
I am sending the following XML to the server:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:open="http://www.openuri.org/">
<soapenv:Header/>
<soapenv:Body>
<enviarDados>
<emitente>
<CnpjEmitente>33042730001771</CnpjEmitente>
<Email>[email protected]</Email>
</emitente>
<documentos>
<Documento>
<DataPagamento>29/05/2013</DataPagamento>
<ItensPagamentos>
<ItemPagamento>
<CepContribuinte>27260390</CepContribuinte>
<Cnpj>33042730001771</Cnpj>
<CodigoProduto>000000000477</CodigoProduto>
<DataVencimento>23/05/2013</DataVencimento>
<DddContribuinte>243</DddContribuinte>
<DiaVencimento>23</DiaVencimento>
<EnderecoContribuinte>RODOVIA BR 393 - LUCIO S/N, KM 5001 VILA SANTA CECILIA</EnderecoContribuinte>
<InformacoesComplementares>ADFASDF</InformacoesComplementares>
<InscEstadualRJ>80541767</InscEstadualRJ>
<MunicipioContribuinte>VOLTA REDONDA</MunicipioContribuinte>
<Natureza>000000000004</Natureza>
<NomeRazaoSocial>COMPANHIA SIDERURGICA NACIONAL - CS</NomeRazaoSocial>
<NotaFiscalCnpj>46044053004607</NotaFiscalCnpj>
<NotaFiscalDataEmissao>23/05/2013</NotaFiscalDataEmissao>
<NotaFiscalNumero>000000002</NotaFiscalNumero>
<NotaFiscalSerie>1</NotaFiscalSerie>
<NotaFiscalTipo>NF-e</NotaFiscalTipo>
<NumControleContribuinte>0000032669</NumControleContribuinte>
<TelefoneContribuinte>2433445194</TelefoneContribuinte>
<TipoApuracao>2</TipoApuracao>
<TipoId>1</TipoId>
<UfContribuinte>RJ</UfContribuinte>
<ValorFECPPrincipal>0.02</ValorFECPPrincipal>
<ValorICMSPrincipal>0.12</ValorICMSPrincipal>
<ValorTotal>0.14</ValorTotal>
</ItemPagamento>
</ItensPagamentos>
<SqDocumento>1</SqDocumento>
<TipoDocumento>1</TipoDocumento>
<TipoPagamento>1</TipoPagamento>
</Documento>
</documentos>
</enviarDados>
</soapenv:Body>
</soapenv:Envelope>
The source that sends the requests to the web service:
function TWebServiceSOAP.Execute(XML: String): String;
var
Retorno, Envio: TStringStream;
begin
try
Envio := TStringStream.Create(XML);
Retorno := TStringStream.Create(EmptyStr);
IdHttp.getCustomHeaders.Add(Format('SOAPAction: "%s"', [SOAPAction]));
try
IdHttp.post(Envio, Retorno);
except On E:Exception do
ShowMessage(E.Message);
end;
Result := Retorno.DataString;
finally
if Assigned(Envio) then
FreeAndNil(Envio);
if Assigned(Retorno) then
FreeAndNil(Retorno);
end;
end;