Recover WSDL from Webservice Nfe ASMX

Asked

Viewed 2,008 times

0

How I recover the WSDL from this service: https://nfe.fazenda.sp.gov.br/ws/recepcaoevento.asmx

I need the WSDL to add it through Netbeans, there I can only add the WSDL and this is final asmx.

EDIT:

My class is like this:

String nfeCabecMsg = "<nfeCabecMsg xmlns=\"http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2\">\n"
            + "\n"
            + "<cUF>35</cUF>\n"
            + "\n"
            + "<versaoDados>2.01</versaoDados>\n"
            + "\n"
            + "</nfeCabecMsg>";

String nfeDadosMsg = "<nfeDadosMsg xmlns=\"http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2\" versao=\"2.00\">\n"
            + "\n"
            + "<consStatServ xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"2.00\">\n"
            + "\n"
            + "<tpAmb>1</tpAmb>\n"
            + "\n"
            + "<cUF>35</cUF>\n"
            + "\n"
            + "<xServ>STATUS</xServ>\n"
            + "\n"
            + "</consStatServ>\n"
            + "\n"
            + "</nfeDadosMsg>";

String teste = new CadConsultaCadastro().getCadConsultaCadastroSoap().consultaCadastro(nfeCabecMsg, nfeDadosMsg);

Error:

error: package br.inf.portalfiscal.nfe.wsdl.cadconsultacadastro does not exist
import br.inf.portalfiscal.nfe.wsdl.cadconsultacadastro.CadConsultaCadastro;

Why are you making this mistake?

1 answer

1

By default services published with ASMX leave the WSDL accessible in a URL ended with ?wsdl, then you can access the WSDL by adding ?wsdl from this url, something like this:

https://nfe.fazenda.sp.gov.br/ws/recepcaoevento.asmx?wsdl

This means that you are asking the server to generate and return the WSDL to you if it has not been disabled on the server.

Some servers also publish WSDL directly, but it is totally dependent on the implementation/configuration, you can also try something like https://nfe.fazenda.sp.gov.br/ws/recepcaoevento.wsdl.

Another thing: this seems to be the event reception service of the state of São Paulo. You can download all the WSDL directly from the site, here. Additionally, the service contract is the same for all Ufs, changing, for some, only the service address. If you can’t access directly or download, you can try some other: relation of werbservices

P.S.: I have no digital certificate to validate access here, see if you can and confirm me :)

  • hello, adding the wsdl does not work, I was able to download the file and add in the project, I started doing a test, but when I run is saying that there is no.... ai gives the following error: package br.inf.portalfiscal.nfe.wsdl.cadquery registration does not exist,;

  • @Himorrivel this is something else, has no relation in how to recover the WSDL. Ask another question, you edit the current one becomes totally meaningless. Basically the IDE has generated code for you that is either in a different package than what you are using, or is not in the classpath.

Browser other questions tagged

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