Skip to content

Commit 61de78e

Browse files
Ajuste URL QRCODE SC, E correção de Status Serviço MS.
1 parent c19efb9 commit 61de78e

File tree

7 files changed

+1354
-10
lines changed

7 files changed

+1354
-10
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ________________________________________________________________________________
3838

3939
# Historico de Versões
4040

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

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

java-nfe-4.00.15-SNAPSHOT.jar

20.9 KB
Binary file not shown.

src/main/java/br/com/swconsultoria/nfe/Status.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe;
44
import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum;
5+
import br.com.swconsultoria.nfe.dom.enuns.EstadosEnum;
56
import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum;
67
import br.com.swconsultoria.nfe.exception.NfeException;
78
import br.com.swconsultoria.nfe.schema_4.consStatServ.TConsStatServ;
@@ -71,16 +72,31 @@ static TRetConsStatServ statusServico(ConfiguracoesNfe config, DocumentoEnum tip
7172

7273
OMElement ome = AXIOMUtil.stringToOM(xml);
7374

74-
NFeStatusServico4Stub.NfeDadosMsg dadosMsg = new NFeStatusServico4Stub.NfeDadosMsg();
75-
dadosMsg.setExtraElement(ome);
75+
if(EstadosEnum.MS.equals(config.getEstado())) {
76+
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeDadosMsg dadosMsg =
77+
new br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeDadosMsg();
78+
dadosMsg.setExtraElement(ome);
7679

77-
NFeStatusServico4Stub stub = new NFeStatusServico4Stub(
78-
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.STATUS_SERVICO));
80+
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub stub =
81+
new br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub(
82+
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.STATUS_SERVICO));
7983

80-
NFeStatusServico4Stub.NfeResultMsg result = stub.nfeStatusServicoNF(dadosMsg);
84+
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeResultMsg result = stub.nfeStatusServicoNF(dadosMsg);
8185

82-
LoggerUtil.log(Status.class, "[XML-RETORNO]: " + result.getExtraElement().toString());
83-
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetConsStatServ.class);
86+
LoggerUtil.log(Status.class, "[XML-RETORNO]: " + result.getExtraElement().toString());
87+
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetConsStatServ.class);
88+
}else{
89+
NFeStatusServico4Stub.NfeDadosMsg dadosMsg = new NFeStatusServico4Stub.NfeDadosMsg();
90+
dadosMsg.setExtraElement(ome);
91+
92+
NFeStatusServico4Stub stub = new NFeStatusServico4Stub(
93+
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.STATUS_SERVICO));
94+
95+
NFeStatusServico4Stub.NfeResultMsg result = stub.nfeStatusServicoNF(dadosMsg);
96+
97+
LoggerUtil.log(Status.class, "[XML-RETORNO]: " + result.getExtraElement().toString());
98+
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetConsStatServ.class);
99+
}
84100

85101
} catch (RemoteException | XMLStreamException | JAXBException e) {
86102
throw new NfeException(e.getMessage());

src/main/java/br/com/swconsultoria/nfe/dom/ConfiguracoesNfe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static ConfiguracoesNfe criarConfiguracoes(EstadosEnum estado, AmbienteEn
8686

8787
if (Logger.getLogger("").isLoggable(Level.SEVERE)) {
8888
System.err.println("####################################################################");
89-
System.err.println(" Api Java Nfe - Versão 4.00.15-SNAPSHOT(F) - 10/06/2021 ");
89+
System.err.println(" Api Java Nfe - Versão 4.00.15-SNAPSHOT(G) - 14/06/2021 ");
9090
if (Logger.getLogger("").isLoggable(Level.WARNING)) {
9191
System.err.println(" Samuel Olivera - [email protected] ");
9292
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* NFeStatusServico4CallbackHandler.java
3+
*
4+
* This file was auto-generated from WSDL
5+
* by the Apache Axis2 version: 1.7.5 Built on : May 06, 2017 (03:45:26 BST)
6+
*/
7+
package br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS;
8+
9+
10+
/**
11+
* NFeStatusServico4CallbackHandler Callback class, Users can extend this class and implement
12+
* their own receiveResult and receiveError methods.
13+
*/
14+
public abstract class NFeStatusServico4CallbackHandler {
15+
protected Object clientData;
16+
17+
/**
18+
* User can pass in any object that needs to be accessed once the NonBlocking
19+
* Web service call is finished and appropriate method of this CallBack is called.
20+
* @param clientData Object mechanism by which the user can pass in user data
21+
* that will be avilable at the time this callback is called.
22+
*/
23+
public NFeStatusServico4CallbackHandler(Object clientData) {
24+
this.clientData = clientData;
25+
}
26+
27+
/**
28+
* Please use this constructor if you don't want to set any clientData
29+
*/
30+
public NFeStatusServico4CallbackHandler() {
31+
this.clientData = null;
32+
}
33+
34+
/**
35+
* Get the client data
36+
*/
37+
public Object getClientData() {
38+
return clientData;
39+
}
40+
41+
/**
42+
* auto generated Axis2 call back method for nfeStatusServicoNF method
43+
* override this method for handling normal response from nfeStatusServicoNF operation
44+
*/
45+
public void receiveResultnfeStatusServicoNF(
46+
br.com.swconsultoria.nfe.wsdl.NFeStatusServico4MS.NFeStatusServico4Stub.NfeResultMsg result) {
47+
}
48+
49+
/**
50+
* auto generated Axis2 Error handler
51+
* override this method for handling error response from nfeStatusServicoNF operation
52+
*/
53+
public void receiveErrornfeStatusServicoNF(java.lang.Exception e) {
54+
}
55+
}

0 commit comments

Comments
 (0)