Skip to content

Commit

Permalink
Ajuste URL QRCODE SC, E correção de Status Serviço MS.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Oliveira committed Jun 14, 2021
1 parent c19efb9 commit 61de78e
Show file tree
Hide file tree
Showing 7 changed files with 1,354 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ________________________________________________________________________________

# Historico de Versões

## v4.00.15 - SNAPSHOT - 28/05/2021
## v4.00.15 - SNAPSHOT - 14/06/2021 (G)
- Removido Cacert do Projeto, agora o projeto Java Certificados irá gerenciar os Cacerts.
- Atualizado Objetos Schema para NT 2020.006 v1.10
- Alterado nome da propriedade contigenciaSCAN para contigenciaSVC
Expand All @@ -49,6 +49,7 @@ ________________________________________________________________________________
- Adicionado a validação de cancelamento fora do prazo.
- Adicinado possibilidade de enviar Evento Manual sem assinatura.
- Adicionado URLS NFCe de Santa Catarina
- Correção de Status Serviço MS.

(Atualizar os Schemas: https://github.com/Samuel-Oliveira/Java_NFe/raw/master/Schemas_2020.006.zip)

Expand Down
Binary file modified java-nfe-4.00.15-SNAPSHOT.jar
Binary file not shown.
30 changes: 23 additions & 7 deletions src/main/java/br/com/swconsultoria/nfe/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe;
import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum;
import br.com.swconsultoria.nfe.dom.enuns.EstadosEnum;
import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum;
import br.com.swconsultoria.nfe.exception.NfeException;
import br.com.swconsultoria.nfe.schema_4.consStatServ.TConsStatServ;
Expand Down Expand Up @@ -71,16 +72,31 @@ static TRetConsStatServ statusServico(ConfiguracoesNfe config, DocumentoEnum tip

OMElement ome = AXIOMUtil.stringToOM(xml);

NFeStatusServico4Stub.NfeDadosMsg dadosMsg = new NFeStatusServico4Stub.NfeDadosMsg();
dadosMsg.setExtraElement(ome);
if(EstadosEnum.MS.equals(config.getEstado())) {
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeDadosMsg dadosMsg =
new br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeDadosMsg();
dadosMsg.setExtraElement(ome);

NFeStatusServico4Stub stub = new NFeStatusServico4Stub(
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.STATUS_SERVICO));
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub stub =
new br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub(
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.STATUS_SERVICO));

NFeStatusServico4Stub.NfeResultMsg result = stub.nfeStatusServicoNF(dadosMsg);
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeResultMsg result = stub.nfeStatusServicoNF(dadosMsg);

LoggerUtil.log(Status.class, "[XML-RETORNO]: " + result.getExtraElement().toString());
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetConsStatServ.class);
LoggerUtil.log(Status.class, "[XML-RETORNO]: " + result.getExtraElement().toString());
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetConsStatServ.class);
}else{
NFeStatusServico4Stub.NfeDadosMsg dadosMsg = new NFeStatusServico4Stub.NfeDadosMsg();
dadosMsg.setExtraElement(ome);

NFeStatusServico4Stub stub = new NFeStatusServico4Stub(
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.STATUS_SERVICO));

NFeStatusServico4Stub.NfeResultMsg result = stub.nfeStatusServicoNF(dadosMsg);

LoggerUtil.log(Status.class, "[XML-RETORNO]: " + result.getExtraElement().toString());
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetConsStatServ.class);
}

} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static ConfiguracoesNfe criarConfiguracoes(EstadosEnum estado, AmbienteEn

if (Logger.getLogger("").isLoggable(Level.SEVERE)) {
System.err.println("####################################################################");
System.err.println(" Api Java Nfe - Versão 4.00.15-SNAPSHOT(F) - 10/06/2021 ");
System.err.println(" Api Java Nfe - Versão 4.00.15-SNAPSHOT(G) - 14/06/2021 ");
if (Logger.getLogger("").isLoggable(Level.WARNING)) {
System.err.println(" Samuel Olivera - [email protected] ");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* NFeStatusServico4CallbackHandler.java
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: 1.7.5 Built on : May 06, 2017 (03:45:26 BST)
*/
package br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS;


/**
* NFeStatusServico4CallbackHandler Callback class, Users can extend this class and implement
* their own receiveResult and receiveError methods.
*/
public abstract class NFeStatusServico4CallbackHandler {
protected Object clientData;

/**
* User can pass in any object that needs to be accessed once the NonBlocking
* Web service call is finished and appropriate method of this CallBack is called.
* @param clientData Object mechanism by which the user can pass in user data
* that will be avilable at the time this callback is called.
*/
public NFeStatusServico4CallbackHandler(Object clientData) {
this.clientData = clientData;
}

/**
* Please use this constructor if you don't want to set any clientData
*/
public NFeStatusServico4CallbackHandler() {
this.clientData = null;
}

/**
* Get the client data
*/
public Object getClientData() {
return clientData;
}

/**
* auto generated Axis2 call back method for nfeStatusServicoNF method
* override this method for handling normal response from nfeStatusServicoNF operation
*/
public void receiveResultnfeStatusServicoNF(
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeResultMsg result) {
}

/**
* auto generated Axis2 Error handler
* override this method for handling error response from nfeStatusServicoNF operation
*/
public void receiveErrornfeStatusServicoNF(java.lang.Exception e) {
}
}
Loading

0 comments on commit 61de78e

Please sign in to comment.