Error 500 when consuming Nfedistribuicaodfe webservice

Asked

Viewed 1,677 times

2

All services are working in my component, only that error service while trying to consume, follows my XML soap that I’m sending

<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
        <soap:Header>

            <nfeCabecMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe">
                <cUF>24</cUF>
                <versaoDados>1.00</versaoDados>
            </nfeCabecMsg>
        </soap:Header>
        <soap:Body>

            <nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe">
               <distDFeInt versao="1.00"  xmlns="http://www.portalfiscal.inf.br/nfe" >
                   <tpAmb>2</tpAmb>
                   <cUFAutor>24</cUFAutor>
                   <CNPJ>35744157000106</CNPJ>
                   <distNSU>
                      <ultNSU>0</ultNSU>
                   </distNSU>
              </distDFeInt>
            </nfeDadosMsg>

        </soap:Body>
    </soap:Envelope>

The return XML is

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <soap:Fault>
         <soap:Code>
            <soap:Value>soap:Receiver</soap:Value>
         </soap:Code>
         <soap:Reason>
            <soap:Text xml:lang="en">Server was unable to process request. ---&gt; Object reference not set to an instance of an object.</soap:Text>
         </soap:Reason>
         <soap:Detail />
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

What’s wrong with my upload XML? being that it is the same XML generation process for the other services that are working.

Someone has an XML example SOAP sending NFeDistribuicaoDFe working?

Webservice : 

hom.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx

Technical note used

 http://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=2ZkcHOdpHs= (NT2014.002_v1.01_WS_Distribuicao_DFE.pdf)

  • If you are using Visual Studio add the reference to Webservice, it will create all the classes referring to Webservice. Do a debug using Nfedistribuicaodfe, then you can see how the shipment is done.

  • I’m using Python, there’s no way I can do this

1 answer

0

Dude, compare it to this one and you’ll find:

<?xml version="1.0" encoding="UTF-8"?>
<soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap12:Header>
        <nfeCabecMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe">
            <cUF>91</cUF>
            <versaoDados>1.00</versaoDados>
        </nfeCabecMsg>
    </soap12:Header>
    <soap12:Body>
        <nfeDistDFeInteresse xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe">
            <nfeDadosMsg>
                <distDFeInt xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.00">
                    <tpAmb>1</tpAmb>
                    <cUFAutor>35</cUFAutor>
                    <CNPJ>CNPJ DA EMPRESA</CNPJ>
                    <distNSU>
                        <ultNSU>000000000000001</ultNSU>
                    </distNSU>
                </distDFeInt>
            </nfeDadosMsg>
        </nfeDistDFeInteresse>
    </soap12:Body>
</soap12:Envelope>
  • You can break this XML in several lines, please?

  • 1

    Ready! @Thiagolunardi

Browser other questions tagged

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