XML Header Electronic Invoice Note

Asked

Viewed 1,338 times

0

I’m having a problem formatting the message we sent to the web service of the service to consume the Nfe service.

Upload this String to the web service:

var sbXml = new StringBuilder();
            sbXml.Append(@"<?xml version=""1.0"" encoding=""UTF-8""?>
             <consStatServ xmlns=""http://www.portalfiscal.inf.br/nfe"" versao=""2.00"">
             <tpAmb>2</tpAmb>
             <cUF>35</cUF>
             <xServ>STATUS</xServ>
             </consStatServ>");

Only I’m getting this:

<retConsStatServ versao="3.10" xmlns="http://www.portalfiscal.inf.br/nfe"><tpAmb>2</tpAmb><verAplic>SP_NFE_PL_008f</verAplic><cStat>239</cStat><xMotivo>Rejeição: Cabeçalho - Versão do arquivo XML não suportada</xMotivo><cUF>35</cUF><dhRecbto>0001-01-01T00:00:00+00:00</dhRecbto></retConsStatServ>

Indicating the following error : Unsupported XML file version

Does anyone know what modification I have to do? , I have checked the version this right, the Web Service accepts.

  • 1

    Are you leaking the quotes? Can you show us the header of this XML generated by this Stringbuilder? I do not advise you to create Xmls like this.

  • You’re sending the right service?

  • The result is this: '<? xml version="1.0" encoding="UTF-8"? ><consStatServ xmlns="portalfiscal.inf.br/nfe"; versao="2.00"><tpAmb>2</tpAmb><cUF>35</cUF><xServ>STATUS</xServ></consStatServ>'

  • What service address you are using?

  • [https://homologacao.nfe.fazenda.sp.gov.br/ws/nfestatusservico2.asmx]

  • 2

    This is version 3. See here: http://www.nfe.fazenda.gov.br/portal/WebServices.aspx. Tried with https://homologacao.nfe.fazenda.sp.gov.br/nfeweb/services/nfestatusservico2.asmx ?

  • Strange as it is, I had already done a test with 3.10 but it didn’t work, I tried again checking the link at the address of version 3 and now it worked . !

  • In fact, better already working with the 3.10 same, soon ends the deadline of the 2.

  • Exactly, vlw for the help !

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.