none
Erro 587 NFe RRS feed

  • Discussão Geral

  • Olá pessoal,

    Estou implementando a transmissao de NFe ver. 2.00. Consigo assinar corretamente e o XML assinado é valido de acordo com o validador da sefaz rs, consigo transmitir para a sefaz sp, e tenho a resposta de lote recebido com sucesso, porém quando pego o num. do recibo e uso o metodo nfeRetRecepcao2 para consultar se foi recebida, ela retorna o erro: "587 Rejeição: Usar somente o namespace padrão da NF-e". Segue abaixo o meu xml assinado:

      <?xml version="1.0" encoding="UTF-8" ?> 
    - <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
    - <infNFe Id="NFe35120745832573000110550010000002851505064061" versao="2.00">
    - <ide>
      <cUF>35</cUF> 
      <cNF>50506406</cNF> 
      <natOp>VENDA DE MERCADORIA DENTRO DO ESTADO</natOp> 
      <indPag>1</indPag> 
      <mod>55</mod> 
      <serie>1</serie> 
      <nNF>285</nNF> 
      <dEmi>2012-07-23</dEmi> 
      <dSaiEnt>2012-07-23</dSaiEnt> 
      <tpNF>1</tpNF> 
      <cMunFG>3552809</cMunFG> 
      <tpImp>1</tpImp> 
      <tpEmis>1</tpEmis> 
      <cDV>1</cDV> 
      <tpAmb>2</tpAmb> 
      <finNFe>1</finNFe> 
      <procEmi>3</procEmi> 
      <verProc>2.2.1</verProc> 
      </ide>
    - <emit>
      <CNPJ>45832573000110</CNPJ> 
      <xNome>IDEA- ME</xNome> 
      <xFant>IDEA</xFant> 
    - <enderEmit>
      <xLgr>RUA FERREIRA</xLgr> 
      <nro>125</nro> 
      <xBairro>PINHEIROS</xBairro> 
      <cMun>3552809</cMun> 
      <xMun>Taboao da Serra</xMun> 
      <UF>SP</UF> 
      <CEP>06720100</CEP> 
      <cPais>1058</cPais> 
      <xPais>BRASIL</xPais> 
      </enderEmit>
      <IE>675162314110</IE> 
      <CRT>1</CRT> 
      </emit>
    - <dest>
      <CNPJ>99999999000191</CNPJ> 
      <xNome>NF-E EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xNome> 
    - <enderDest>
      <xLgr>R JAMES HOLLAND</xLgr> 
      <nro>422</nro> 
      <xBairro>BARRA FUNDA</xBairro> 
      <cMun>3550308</cMun> 
      <xMun>Sao Paulo</xMun> 
      <UF>SP</UF> 
      <CEP>01138909</CEP> 
      <cPais>1058</cPais> 
      <xPais>BRASIL</xPais> 
      </enderDest>
      <IE /> 
      </dest>
    - <det nItem="1">
    - <prod>
      <cProd>012</cProd> 
      <cEAN /> 
      <xProd>PANTONE FORMULA GUIDE</xProd> 
      <NCM>49019900</NCM> 
      <CFOP>5102</CFOP> 
      <uCom>1</uCom> 
      <qCom>1.0000</qCom> 
      <vUnCom>398.0000000000</vUnCom> 
      <vProd>398.00</vProd> 
      <cEANTrib /> 
      <uTrib>1</uTrib> 
      <qTrib>1.0000</qTrib> 
      <vUnTrib>398.0000000000</vUnTrib> 
      <indTot>1</indTot> 
      </prod>
    - <imposto>
    - <ICMS>
    - <ICMSSN102>
      <orig>2</orig> 
      <CSOSN>400</CSOSN> 
      </ICMSSN102>
      </ICMS>
    - <PIS>
    - <PISNT>
      <CST>07</CST> 
      </PISNT>
      </PIS>
    - <COFINS>
    - <COFINSNT>
      <CST>07</CST> 
      </COFINSNT>
      </COFINS>
      </imposto>
      </det>
    - <total>
    - <ICMSTot>
      <vBC>0.00</vBC> 
      <vICMS>0.00</vICMS> 
      <vBCST>0.00</vBCST> 
      <vST>0.00</vST> 
      <vProd>398.00</vProd> 
      <vFrete>0.00</vFrete> 
      <vSeg>0.00</vSeg> 
      <vDesc>0.00</vDesc> 
      <vII>0.00</vII> 
      <vIPI>0.00</vIPI> 
      <vPIS>0.00</vPIS> 
      <vCOFINS>0.00</vCOFINS> 
      <vOutro>0.00</vOutro> 
      <vNF>398.00</vNF> 
      </ICMSTot>
      </total>
    - <transp>
      <modFrete>0</modFrete> 
      </transp>
      </infNFe>
    - <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
    - <SignedInfo>
      <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> 
      <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> 
    - <Reference URI="#NFe35120745832573000110550010000002851505064061">
    - <Transforms>
      <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /> 
      <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> 
      </Transforms>
      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
      <DigestValue>8OSe88y0OBq7pJTkHc+SLT/6QUk=</DigestValue> 
      </Reference>
      </SignedInfo>
      <SignatureValue>DvvrKF1P5sv/RrtUodEqkqnTlpvORdfwJBmlXXX2q+C2x4u0xcykNymC46NSCYs0qpMUQLHk/L5nmAYWJ9Y3KC+IOvvqd/M1nTh5M5pWT5rlZN4QDWP/yPfHxCw/ehGcXRGb40DDMVxUA+//+snUppKfC6jsSxsVslddJKYZFCs=</SignatureValue> 
    - <KeyInfo>
    - <X509Data>
      <X509Certificate>MIIGNTCCBR2gAwIBAgIIH+HjBTMxmvMwDQYJKoZIhvcNAQEFBQAwTDELMAkGA1UEBhMCQlIxEzARBgNVBAoTCklDUC1CcmFzaWwxKDAmBgNVBAMTH1NFUkFTQSBDZXJ0aWZpY2Fkb3JhIERpZ2l0YWwgdjEwHhcNMTEwODA5MTQ0OTI3WhcNMTIwODA4MTQ0OTI3WjCB9DELMAkGA1UEBhMCQlIxEzARBgNVBAoTCklDUC1CcmFzaWwxFDASBgNVBAsTCyhFTSBCUkFOQ08pMRgwFgYDVQQLEw8wMDAwMDEwMDIwMzgzMDAxFDASBgNVBAsTCyhFTSBCUkFOQ08pMRQwEgYDVQQLEwsoRU0gQlJBTkNPKTEUMBIGA1UECxMLKEVNIEJSQU5DTykxFDASBgNVBAsTCyhFTSBCUkFOQ08pMRQwEgYDVQQLEwsoRU0gQlJBTkNPKTEyMDAGA1UEAxMpSURFQSBCT09LUyBDT01FUkNJTyBERSBSRVZJU1RBUyBMVERBIC0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IGHMEcGCCsGAQUFBzAChjtodHRwOi8vd3d3LmNlcnRpZmljYWRvZGlnaXRhbC5jb20uYnIvY2FkZWlhcy9zZXJhc2FjZHYxLnA3YjA8BggrBgEFBQcwAYYwaHR0cDovL29jc3AuY2VydGlmaWNhZG9kaWdpdGFsLmNvbS5ici9zZXJhc2FjZHYxMA0GCSqGSIb3DQEBBQUAA4IBAQAkSW5PzQFZLpsCOB/bipH57QqLy/juDin1SBhrxoYIjN3YplUFHScwI/UTD32uxarrdNUKJaZzJMPaJflzc8y8UwjA6nzTk3kxyeUvth3o+UaN+wpxNsF2SeNdaWmycOmKSH39wcA+7/EJj7DSxHvyMEC3beEHOxACB1TQ8hVE70s0HgDDgIcR3Zuc2eZ3Bij6m1NKrT8hVS+UGP+Zlz28DniNaxBepebS4trolHlwOcM9n76Yt9zUoM8dRyAAfdyFqlwG9Gv+V1mfnod7hYRZXAluiD18ebZSlZAfMHoU3bipbObSQh6HCuI0zUBgl7idW2lsjfi42Cl/kAaJVh3f</X509Certificate> 
      </X509Data>
      </KeyInfo>
      </Signature>
      </NFe>

    E o metodo para transmissao e consulta é:

    string xmlNFe = null;
                ws_Recepcao.NfeRecepcao2 recepcao = null;
                ws_RetRecepcao.NfeRetRecepcao2 retorno = null;
                XmlDocument doc = null;
                string xmlConsulta = null;
                string rec = null;
                string xmlEnvio = null;
                object r = null;
    
                Console.WriteLine("Iniciando...");
    
                xmlNFe = File.ReadAllText("c:\\temp\\35120745832573000110550010000002851505064061-nfe.xml", Encoding.UTF8);
                xmlNFe = xmlNFe.Replace("\n", "").Replace("\r", "").Replace("\t", "").Replace("  ", "");
                xmlNFe = AssinarXML(xmlNFe, CarregarCertificado());
                xmlNFe = xmlNFe.Replace("\n", "").Replace("\r", "").Replace("\t", "").Replace("  ", "");
    
                doc = new XmlDocument();
                doc.PreserveWhitespace = false;
    
                doc.LoadXml(xmlNFe);
    
                doc.PreserveWhitespace = false;
    
                xmlEnvio = "<?xml version=\"1.0\" ?><nfeDadosMsg><enviNFe xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"2.00\"><idLote>000000031592012</idLote>" + doc["NFe"].OuterXml + "</enviNFe></nfeDadosMsg>";
    
                xmlEnvio = xmlEnvio.Replace("\n", "").Replace("\r", "").Replace("\t", "").Replace("  ", " ");
    
                doc.LoadXml(xmlEnvio);
    
                recepcao = new ws_Recepcao.NfeRecepcao2();
                recepcao.ClientCertificates.Add(CarregarCertificado());
                recepcao.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
                recepcao.nfeCabecMsgValue = new ws_Recepcao.nfeCabecMsg();
                recepcao.nfeCabecMsgValue.cUF = "35";
                recepcao.nfeCabecMsgValue.versaoDados = "2.00";
    
                r = recepcao.nfeRecepcaoLote2(doc);
    
    
    
    
                //CONSULTA DO RECIBO
                rec = ((XmlNode)r)["infRec"]["nRec"].InnerText;
                xmlConsulta = "<?xml version=\"1.0\"?><consReciNFe xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"2.00\"><tpAmb>" + System.Configuration.ConfigurationManager.AppSettings["ambiente"] + "</tpAmb><nRec>" + rec + "</nRec></consReciNFe>";
                xmlConsulta = xmlConsulta.Replace("\n", "").Replace("\r", "").Replace("\t", "").Replace("  ", " ");
    
                doc = new XmlDocument();
                doc.PreserveWhitespace = false;
                doc.LoadXml(xmlConsulta);
                retorno = new ws_RetRecepcao.NfeRetRecepcao2();
                retorno.nfeCabecMsgValue = new ws_RetRecepcao.nfeCabecMsg();
                retorno.nfeCabecMsgValue.cUF = "35";
                retorno.nfeCabecMsgValue.versaoDados = "2.00";
                retorno.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
                retorno.ClientCertificates.Add(CarregarCertificado());
                
                object r2 = retorno.nfeRetRecepcao2(doc);

    Agradeço qualquer tipo de ajuda.

    Abs!!


    MCSD, MCT

    terça-feira, 24 de julho de 2012 06:01

Todas as Respostas

  • Ola pessoal,

    Problema resolvido, era nesta linha:

     xmlEnvio = "<?xml version=\"1.0\" ?><nfeDadosMsg><enviNFe xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"2.00\"><idLote>000000031592012</idLote>" + doc["NFe"].OuterXml + "</enviNFe></nfeDadosMsg>";
    

    Troquei para isso:

     xmlEnvio = "<?xml version=\"1.0\" ?><nfeDadosMsg><enviNFe versao=\"2.00\"  xmlns=\"http://www.portalfiscal.inf.br/nfe\"><idLote>000000031592012</idLote>" + doc["NFe"].OuterXml + "</enviNFe></nfeDadosMsg>";
    

    E funcionou.


    MCSD, MCT

    quarta-feira, 25 de julho de 2012 13:33