Doubts about how to consume Ws Nfs-e Curitiba

Asked

Viewed 1,209 times

-2

inserir a descrição da imagem aqui


Now following my return only comes so

<EnviarLoteRpsResposta xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NumeroLote xsi:nil="true" />
  <DataRecebimento xsi:nil="true" />
  <ListaMensagemRetorno>
    <MensagemRetorno>
      <Codigo>E504</Codigo>
      <Mensagem>O certificado digital do prestador de serviços é obrigatório.</Mensagem>
      <Correcao>Envie junto a requisição do serviço o certificado digital do prestador de serviços.</Correcao>
    </MensagemRetorno>
  </ListaMensagemRetorno>
</EnviarLoteRpsResposta>

Follow my authentication

  public void chamadaWs(String xml) {
        URL wsdlURL = WSX0020X0020NFSEX0020V1001.WSX0020X0020NFSEX0020V1001_WSDL_LOCATION;
        QName WSX0020X0020NFSEX0020V1001_QNAME = new QName("http://www.e-governeapps2.com.br/", "WS_x0020_-_x0020_NFS-e_x0020_V1.0.0.1");
        WSX0020X0020NFSEX0020V1001 ss = new WSX0020X0020NFSEX0020V1001(wsdlURL, WSX0020X0020NFSEX0020V1001_QNAME);
        WSX0020X0020NFSEX0020V1001Soap port = ss.getWSX0020X0020NFSEX0020V1001Soap();

        String retorno = port.recepcionarXml("RecepcionarLoteRps", xml);

        System.out.println("recepcionarLoteRps.result=" + retorno);
    }

    private void autentica() {
        String caminhoDoCertificadoDoCliente = "C:\\Nf-se\\certificado.pfx";
        String senhaDoCertificadoDoCliente = "123456";
        String caminhoDoKeyStore = "C:\\Nf-se\\cacerts";
        String senhaDoKeyStore = "123456";

        System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
        Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
        System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
        System.clearProperty("javax.net.ssl.keyStore");
        System.clearProperty("javax.net.ssl.keyStorePassword");
        System.clearProperty("javax.net.ssl.trustStore");
        System.setProperty("javax.net.ssl.keyStore", caminhoDoCertificadoDoCliente);
        System.setProperty("javax.net.ssl.keyStorePassword", senhaDoCertificadoDoCliente);
        System.setProperty("javax.net.ssl.trustStoreType", "JKS");
        System.setProperty("javax.net.ssl.trustStore", caminhoDoKeyStore);

    }
  • how to start. https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=how%20to%20consume%20a%20wsdl%20in%20java

  • in vdd I just need to run a method of that Ws which would be Recepcionarxml, where I pass the method name and xml !!!!

  • I have a solution for shipping, but it’s in C#. Help?

  • help if you can send

  • Look, I’m noticing that your issues are completely changing the initial doubt, and it’s not right to do that. If the solution below resulted another doubt, one should open a new question, do not change the recent, otherwise you invalidate the answers already given.

  • in vdd the doubt remains the same , however with different situations , but the problem has not changed yet , therefore the change

  • It has a lot of screenshot and little clarity on the problem. The message is already says that you are not using digital certificate, but there is no way to know where you are "tangled". It would be the case to either explain the difficulty you are having with the certificate or with the code. But you will probably have to open a question about the exact problem. (It is no use to open another generic, it has to be a specific one about the problem and not about the error message, which has already been discussed here). Here are some tips: [Ask]

Show 2 more comments

2 answers

2

The Municipality of Curitiba was once my client. Normally, the Web Services of them are made in C#, whose documentation can be easily accessible through the address:

https://isscuritiba.curitiba.pr.gov.br/Iss.NfseWebService/nfsews.asmx

In this case, the method you need to call is the RecepcionarXml, that is here:

https://isscuritiba.curitiba.pr.gov.br/Iss.NfseWebService/nfsews.asmx?op=RecepcionarXml

The best way to test this manually is by using a tool like the Soapui. Just use this WSDL within a Soapui request and the application mounts the XML of the request for you. You will need to manually paste the XML into the request form to be able to send. Here is a tutorial.

Done that, that’s enough consume the Web Service.

  • Help me friend I will post error alii

  • Friends now I have another mistake , I will post try to help me

0

The connection is HTTPS so you need to have the digital certificate type A1/A4 to access the wsdl, or create a fake certificate on their website for the pilot server, has it in manuals.

Only if you use the pilot certificate I believe you will have limitations for consumption, then the best would be a true certificate.

http://pilotoisscuritiba.curitiba.pr.gov.br:8080/certsrv/

HTTPS:

You need to generate a cacerts file with the keys, da to make with the Java keytool or use that Installcert.java class that has numerous versions out there, including in my own gist.

at this point you add https' url, as many as you need as you increase the number of prefectures.

get("isscuritiba.curitiba.pr.gov.br", 443, Ks);

As for the certificate using the pilot or an original certificate nothing will happen if not link the same in their system, and for this a registration with the city is necessary.

In the past when I developed I spent a lot of time trying to make it work later I discovered that it was only possible to do it through the browser I.E (I don’t know if it’s still like this).

After these steps are ready you will be able to test with Soapui and also generate your Java stubs to use in code the invocation to these services, but you need to read the manuals, have everything there.

Estates:

 public static void AssinaSSL(String caminhoCertificado, String senhaCertificado) {
        System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
        System.clearProperty("javax.net.ssl.keyStore");
        System.clearProperty("javax.net.ssl.keyStorePassword");
        System.clearProperty("javax.net.ssl.trustStore");
        Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
        System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
        System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
        System.setProperty("javax.net.ssl.keyStore", caminhoCertificado);
        System.setProperty("javax.net.ssl.keyStorePassword", senhaCertificado);
        System.setProperty("javax.net.ssl.trustStoreType", "JKS");
        System.setProperty("javax.net.ssl.trustStore", "/nfse/certificados/cacerts");
    }

Browser other questions tagged

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