NF-e query with response: "Paralyzed Service without Forecast"

Asked

Viewed 815 times

4

I am doing in a project a NF-e XML search and download module together with SEFAZ.

I made all the settings and pointed the requests to the Webservice informed on the website of the recipe but the same is returning the following error:

<retDownloadNFe versao="1.00" xmlns="http://www.portalfiscal.inf.br/nfe">
    <tpAmb>1</tpAmb>
    <verAplic>AN.DownNF_2.1.1</verAplic>
    <cStat>109</cStat>
    <xMotivo>Servico Paralisado sem Previsao</xMotivo>
    <dhResp>2017-08-15T09:58:12</dhResp>
</retDownloadNFe>

Does anyone have any idea what it might be?

  • which UF and which URL you are using ?

  • You have just posted the same question: https://answall.com/questions/229137/download-nfe-nfephp , it may be some change of revenue service, it must have something to do with this http://www.contabeis.com.br/noticias/35193/cfc-alert_overdosionstax-electronic/

  • UF - SP URL as reported in the documentation: http://hom.nfe.fazenda.gov.br/portal/webServices.aspx?tipConteudo=Wak0FwB7dKs=#AN

  • Look, it looks like the service is paralyzed. I don’t know if you have any experience with the IRS, but this is very common.

  • The worst is that on the SEFAZ service availability page appears as if everything is working normally.

  • I had this problem with Sefaz some time ago and it was due to the modification of the Consulted method...

  • @Jcsaint you have the solution used for this problem?

Show 2 more comments

1 answer

3

The webservice Downloadnfe has been disabled as per NT 2014.002.v.1.02.

The webservice you should use is:

https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx

In this webservice you perform the recipient’s manifestation and in the next query it returns the full XML of Nfe.

Follow link to the technical note: Technical Note 2014.002 - v1.02

I made a very simple example, put a button and a textbox in a form. I added the webservice address in the visual studio project as Servicereference, so the visual studio already generates the necessary class. Follows code:

Do not forget to replace the code data with your company data, and without reading the technical note there is no way you understand the return of the webservice.

    private void button1_Click(object sender, EventArgs e)
    {
        NFeDistribuicaoDFeSoapClient consDFe = new NFeDistribuicaoDFeSoapClient();

        consDFe.ClientCredentials.ClientCertificate.Certificate = ObterDoRepositorio();
        distDFeInt distDfe = new distDFeInt();
        distDfe.versao = TVerDistDFe.Item100;
        distDfe.tpAmb = TAmb.Item1;
        distDfe.cUFAutor = TCodUfIBGE.Item50;
        distDfe.ItemElementName = ItemChoiceType.CNPJ;
        distDfe.Item = "000000000000000";
        distDFeIntDistNSU distNSU = new distDFeIntDistNSU();
        distNSU.ultNSU = "000000000";
        distDfe.Item1 = distNSU;
        string xmlEnvio = SerializeToString(distDfe);
        var removeq1 = new string[] { ":q1", "q1:" };
        foreach (var item in removeq1)
        {
            xmlEnvio = xmlEnvio.Replace(item, string.Empty);
        }
        XElement xml = XElement.Parse(xmlEnvio);
        var asd = consDFe.nfeDistDFeInteresse(xml);
        textBox1.Text = asd.ToString();


    }

    public static X509Certificate2 ObterDoRepositorio()
    {
        var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
        store.Open(OpenFlags.OpenExistingOnly | OpenFlags.MaxAllowed);

        var collection = store.Certificates;
        var fcollection = collection.Find(X509FindType.FindByTimeValid, DateTime.Now, true);
        var scollection = X509Certificate2UI.SelectFromCollection(fcollection, "Certificados válidos:", "Selecione o certificado que deseja usar",
            X509SelectionFlag.SingleSelection);

        if (scollection.Count == 0)
        {
            throw new Exception("Nenhum certificado foi selecionado!");
        }

        store.Close();
        return scollection[0];
    }

    public static string SerializeToString(Object value)
    {
        var emptyNamepsaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty });
        var serializer = new XmlSerializer(value.GetType());
        var settings = new XmlWriterSettings();
        settings.OmitXmlDeclaration = true;

        using (var stream = new StringWriter())
        using (var writer = XmlWriter.Create(stream, settings))
        {
            serializer.Serialize(writer, value, emptyNamepsaces);
            return stream.ToString();
        }
    }

Link on github

  • good afternoon, I have the same problem and I tried to use this mentioned webservice and I did not succeed... I would have some example that can guide me better?

  • @Thiagomottabarboza, I posted a well-zoado code example, more is working. Maybe it serves as a basis for you.

  • forgive my ignorance and if I did something wrong but using this code there was the same return of error... :/

  • You created a project from scratch and included Servicereference ?

  • Yes, now this giving error in Nfedistribuicaodfesoapclient

  • I think I made the error I put name of the wrong reference this client reference is the server... I’ll tidy up here and tell you how it was

  • sorry for the inconvenience but is there any way you can send this project to me? can’t make it work...

  • @Thiagomottabarboza, I’ll add on github and step you.

  • thanks will help me a lot!

  • @Thiagomottabarboza, the answer is edited with the link on github.

  • <retDistDFeInt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" versao="1.00" xmlns="http://www.portalfiscal.inf.br/nfe">&#xA; <tpAmb>1</tpAmb>&#xA; <verAplic>1.1.9</verAplic>&#xA; <cStat>215</cStat>&#xA; <xMotivo>Rejeicao: Falha no esquema xml</xMotivo>&#xA; <dhResp>2017-08-18T19:33:35</dhResp>&#xA; <ultNSU>000000000000000</ultNSU>&#xA; <maxNSU>000000000000000</maxNSU>&#xA;</retDistDFeInt>

  • Same Robss error, in this case the NSU is zeroed because it would return everything, however I think the xml message must have been changed, I will give a search here, giving right warning

  • Good Afternoon, for those who went through the problem I went through, ta ai ai é só fazer o download. https://github.com/thgmbz/DownloadXML-NT2014.002

Show 9 more comments

Browser other questions tagged

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