Skip to content

Commit

Permalink
Merge pull request #30 from fincatto/dev
Browse files Browse the repository at this point in the history
Adicionado lancamento de excecao para processamento sincrono
  • Loading branch information
jefperito committed Apr 2, 2015
2 parents 9212404 + 4281245 commit 18cca5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/fincatto/nfe310/webservices/WSFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import com.fincatto.nfe310.classes.lote.consulta.NFLoteConsultaRetorno;
import com.fincatto.nfe310.classes.lote.envio.NFLoteEnvio;
import com.fincatto.nfe310.classes.lote.envio.NFLoteEnvioRetorno;
import com.fincatto.nfe310.classes.lote.envio.NFLoteIndicadorProcessamento;
import com.fincatto.nfe310.classes.nota.consulta.NFNotaConsultaRetorno;
import com.fincatto.nfe310.classes.statusservico.consulta.NFStatusServicoConsultaRetorno;
import com.fincatto.nfe310.validadores.xsd.XMLValidador;

public class WSFacade {

private final WSLoteEnvio wsLoteEnvio;
private final WSLoteConsulta wsLoteConsulta;
private final WSStatusConsulta wsStatusConsulta;
Expand Down Expand Up @@ -46,6 +46,9 @@ public WSFacade(final NFeConfig config) throws IOException {

public NFLoteEnvioRetorno enviaLote(final NFLoteEnvio lote) throws Exception {
XMLValidador.validaLote(lote.toString());
if (lote.getIndicadorProcessamento().equals(NFLoteIndicadorProcessamento.PROCESSAMENTO_SINCRONO)) {
throw new IllegalStateException("Nao existe ainda a forma de envio sincrona, faca o envio de forma assincrona");
}
return this.wsLoteEnvio.enviaLote(lote);
}

Expand Down

0 comments on commit 18cca5d

Please sign in to comment.