Error while consuming Nfe service

Asked

Viewed 822 times

0

good afternoon,

am making a webservice on Asp.net to consume the farm site’s Nfe service, however when trying to add service reference in the project with the url:

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

is giving me a mistake:

An error occurred while downloading 'https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx/$Metadata'. Request failed with HTTP status 403: Forbidden. Metadata contains a reference that cannot be resolved: 'https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx'. The HTTP request is prohibited with the 'Anonymous' client authentication scheme. Remote server returned an error: (403) Forbidden. If the service is defined in the current solution, try to compile the solution and add the service reference again.

inserir a descrição da imagem aqui

Someone can help me?

Thanks in advance.

  • You probably want to use the address https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe?wsdl instead of https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx

  • I got the url of the site itself

  • But for add the service has to use the URL I indicated.

  • returns the same error...

  • 1

    If you are returning 403 it is because you do not have a valid certificate.

  • added the image for you to see

  • already installed the certificate, and is valid... install normally? I need to link somewhere in the code ?

  • Buddy, I tried to add it that way, too, and it didn’t work. I did so by following this tutorial by adding the methods via code and it worked: https://answall.com/questions/241783/consumr-soap12-nf-e-uf-ba good luck..

Show 3 more comments

1 answer

0

You have to reference in Web Services goes in Advanced -> Add Web Reference

And with Valid certificate otherwise it will fail.

Browser other questions tagged

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