Closed DanielChrome closed 5 years ago
Eu tive este erro aí com a NFS-e num município específico. Para resolver, tive que setar a opção CHUNKED para false no Stub. No teu caso, não sei exatamente como tu faria (pois o stub é criado dentro da lib, antes de usar, na classe WSLoteEnvio), mas teria que fazer isto no NFeAutorizacao4Stub antes de fazer o envio.
ServiceClient serviceClient = ((org.apache.axis2.client.Stub)stub)._getServiceClient();
serviceClient.getOptions().setProperty( HTTPConstants.CHUNKED, false);
Obrigado Daniel. Já tinha resolvido com esta sua ajuda e quando vim postar a resposta vi seu comentário, obrigado.
No meu caso adicionei a seguinte linha no método nfeAutorizacaoLote da classe NFeAutorizacao4Stub:
_operationClient.getOptions().setProperty(HTTPConstants.CHUNKED, false);
Obrigado! Aqui a solução funcionou também
Olá, estou testando o envio de NFC-e para MG. Quando envio a NFC-e com apenas um item, é transmitida normalmente, porém, se coloco mais de um item ocorre o erro:
org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required
Testei em outras Ufs e não ocorre o problema.
Também não creio que seja algo no servidor da Sefaz de MG (Que por sinal é uma merda), porque, testando por outra aplicação feita em C#, a nota com vários itens é emitida sem problemas.
Segue o XML de envio de exemplo:
<enviNFe versao="4.00" xmlns="http://www.portalfiscal.inf.br/nfe"><idLote>20190325121129</idLote><indSinc>1</indSinc><NFe><infNFe Id="NFe31190307694270000199650180000000501935100404" versao="4.00"><ide><cUF>31</cUF><cNF>93510040</cNF><natOp>5102/5405 VENDA MERC. DENT. ESTADO</natOp><mod>65</mod><serie>18</serie><nNF>50</nNF><dhEmi>2019-03-25T12:11:28-03:00</dhEmi><tpNF>1</tpNF><idDest>1</idDest><cMunFG>3143302</cMunFG><tpImp>4</tpImp><tpEmis>1</tpEmis><cDV>4</cDV><tpAmb>2</tpAmb><finNFe>1</finNFe><indFinal>1</indFinal><indPres>1</indPres><procEmi>0</procEmi><verProc>1.0.0</verProc></ide><emit><CNPJ>07694270000199</CNPJ><xNome>GGT SISTEMAS LTDA</xNome><xFant>ATS INFORMATICA</xFant><enderEmit><xLgr>R. PADRE AUGUSTO</xLgr><nro>123</nro><xBairro>CENTRO</xBairro><cMun>3143302</cMun><xMun>MONTES CLAROS</xMun><UF>MG</UF><CEP>30430520</CEP><cPais>1058</cPais><xPais>BRASIL</xPais><fone>7199375132</fone></enderEmit><IE>0010335940021</IE><IM>2253698</IM><CNAE>4722901</CNAE><CRT>3</CRT></emit><autXML><CNPJ>01339695000101</CNPJ></autXML><det nItem="1"><prod><cProd>000001</cProd><cEAN>SEM GTIN</cEAN><xProd>NOTA FISCAL EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xProd><NCM>02013000</NCM><CFOP>5102</CFOP><uCom>KG</uCom><qCom>1</qCom><vUnCom>10.99</vUnCom><vProd>10.99</vProd><cEANTrib>SEM GTIN</cEANTrib><uTrib>KG</uTrib><qTrib>1</qTrib><vUnTrib>10.99</vUnTrib><indTot>1</indTot><nItemPed>1</nItemPed></prod><imposto><ICMS><ICMS00><orig>0</orig><CST>00</CST><modBC>3</modBC><vBC>10.99</vBC><pICMS>18.00</pICMS><vICMS>1.98</vICMS></ICMS00></ICMS><PIS><PISOutr><CST>99</CST><vBC>0.00</vBC><pPIS>0.00</pPIS><vPIS>0.00</vPIS></PISOutr></PIS><COFINS><COFINSOutr><CST>99</CST><vBC>0.00</vBC><pCOFINS>0.00</pCOFINS><vCOFINS>0.00</vCOFINS></COFINSOutr></COFINS></imposto></det><det nItem="2"><prod><cProd>000002</cProd><cEAN>SEM GTIN</cEAN><xProd>NOTA FISCAL EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xProd><NCM>02013000</NCM><CFOP>5102</CFOP><uCom>KG</uCom><qCom>1</qCom><vUnCom>9.99</vUnCom><vProd>9.99</vProd><cEANTrib>SEM GTIN</cEANTrib><uTrib>KG</uTrib><qTrib>1</qTrib><vUnTrib>9.99</vUnTrib><indTot>1</indTot><nItemPed>2</nItemPed></prod><imposto><ICMS><ICMS00><orig>0</orig><CST>00</CST><modBC>3</modBC><vBC>9.99</vBC><pICMS>18.00</pICMS><vICMS>1.80</vICMS></ICMS00></ICMS><PIS><PISOutr><CST>99</CST><vBC>0.00</vBC><pPIS>0.00</pPIS><vPIS>0.00</vPIS></PISOutr></PIS><COFINS><COFINSOutr><CST>99</CST><vBC>0.00</vBC><pCOFINS>0.00</pCOFINS><vCOFINS>0.00</vCOFINS></COFINSOutr></COFINS></imposto></det><det nItem="3"><prod><cProd>000032</cProd><cEAN>SEM GTIN</cEAN><xProd>NOTA FISCAL EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xProd><NCM>02013000</NCM><CFOP>5102</CFOP><uCom>KG</uCom><qCom>1</qCom><vUnCom>15.99</vUnCom><vProd>15.99</vProd><cEANTrib>SEM GTIN</cEANTrib><uTrib>KG</uTrib><qTrib>1</qTrib><vUnTrib>15.99</vUnTrib><indTot>1</indTot><nItemPed>3</nItemPed></prod><imposto><ICMS><ICMS00><orig>0</orig><CST>00</CST><modBC>3</modBC><vBC>15.99</vBC><pICMS>18.00</pICMS><vICMS>2.88</vICMS></ICMS00></ICMS><PIS><PISOutr><CST>99</CST><vBC>0.00</vBC><pPIS>0.00</pPIS><vPIS>0.00</vPIS></PISOutr></PIS><COFINS><COFINSOutr><CST>99</CST><vBC>0.00</vBC><pCOFINS>0.00</pCOFINS><vCOFINS>0.00</vCOFINS></COFINSOutr></COFINS></imposto></det><det nItem="4"><prod><cProd>000004</cProd><cEAN>SEM GTIN</cEAN><xProd>NOTA FISCAL EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xProd><NCM>02013000</NCM><CFOP>5102</CFOP><uCom>KG</uCom><qCom>1</qCom><vUnCom>23.99</vUnCom><vProd>23.99</vProd><cEANTrib>SEM GTIN</cEANTrib><uTrib>KG</uTrib><qTrib>1</qTrib><vUnTrib>23.99</vUnTrib><indTot>1</indTot><nItemPed>4</nItemPed></prod><imposto><ICMS><ICMS00><orig>0</orig><CST>00</CST><modBC>3</modBC><vBC>23.99</vBC><pICMS>18.00</pICMS><vICMS>4.32</vICMS></ICMS00></ICMS><PIS><PISOutr><CST>99</CST><vBC>0.00</vBC><pPIS>0.00</pPIS><vPIS>0.00</vPIS></PISOutr></PIS><COFINS><COFINSOutr><CST>99</CST><vBC>0.00</vBC><pCOFINS>0.00</pCOFINS><vCOFINS>0.00</vCOFINS></COFINSOutr></COFINS></imposto></det><total><ICMSTot><vBC>60.96</vBC><vICMS>10.98</vICMS><vICMSDeson>0.00</vICMSDeson><vFCP>0.00</vFCP><vBCST>0.00</vBCST><vST>0.00</vST><vFCPST>0.00</vFCPST><vFCPSTRet>0.00</vFCPSTRet><vProd>60.96</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0.00</vII><vIPI>0.00</vIPI><vIPIDevol>0.00</vIPIDevol><vPIS>0.00</vPIS><vCOFINS>0.00</vCOFINS><vOutro>0.00</vOutro><vNF>60.96</vNF></ICMSTot></total><transp><modFrete>9</modFrete></transp><pag><detPag><indPag>0</indPag><tPag>01</tPag><vPag>60.96</vPag></detPag><vTroco>0.00</vTroco></pag><infAdic><infCpl>OPERADOR: 00001 - ELIENE</infCpl></infAdic></infNFe><infNFeSupl><qrCode><![CDATA[https://nfce.fazenda.mg.gov.br/portalnfce/sistema/qrcode.xhtml?p=31190307694270000199650180000000501935100404|2|2|1|D227419AA8C7BEFA00234A72149E1B26D3A51657]]></qrCode><urlChave>http://hnfce.fazenda.mg.gov.br/portalnfce</urlChave></infNFeSupl><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="#NFe31190307694270000199650180000000501935100404"><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>pbVrndRolhEq+k0EV2WkHxdgNA4=</DigestValue></Reference></SignedInfo><SignatureValue>lj5QTg6VuRTmx6rXSeRnHeMHh2OAQFM3neEg43eCaK3y7OlM4AbCElYNxqZHmgvxF1ZCwdzyUZp2 l3XhRDe3FPN8S+je3Qe5h1czIKgY/wANR7EMHR3CFTrmtszcbMkFo4WsLz4hlKL1LaGjXg20PSo0 +gduesQPzKwGPxnFgOrNCRsLim2v+Ga/D3xWa/x/N5twboFSBOUgnWA94hJKYIEX+MP1Ai948U5t 3xGSBaQZRCiSas5mNJ4KtkVG/C8i3ZGSkrukMxGpXlCYjoAyLrEtrb06HEjNSAtaCU+wL07f0gDq MKaui+n5aduhOpXX6C0rWTL7T+dGcZKswpWNkA==</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIH7jCCBdagAwIBAgIIaHVWU2EEukUwDQYJKoZIhvcNAQELBQAwcDELMAkGA1UEBhMCQlIxEzAR BgNVBAoTCklDUC1CcmFzaWwxNjA0BgNVBAsTLVNlY3JldGFyaWEgZGEgUmVjZWl0YSBGZWRlcmFs IGRvIEJyYXNpbCAtIFJGQjEUMBIGA1UEAxMLQUMgTElOSyBSRkIwHhcNMTgwNzI1MTU1MzQzWhcN MTkwNzI1MTU1MzQzWjCB1DELMAkGA1UEBhMCQlIxCzAJBgNVBAgTAk1HMRYwFAYDVQQHEw1NT05U RVMgQ0xBUk9TMRMwEQYDVQQKEwpJQ1AtQnJhc2lsMTYwNAYDVQQLEy1TZWNyZXRhcmlhIGRhIFJl Y2VpdGEgRmVkZXJhbCBkbyBCcmFzaWwgLSBSRkIxFjAUBgNVBAsTDVJGQiBlLUNOUEogQTExEDAO BgNVBAsTB0FSIExJTksxKTAnBgNVBAMTIEdHVCBTSVNURU1BUyBMVERBOjA3Njk0MjcwMDAwMTk5 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI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