diff --git a/gradle.properties b/gradle.properties index be3d010..de7cd94 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.0.16-BETA +version=0.0.17-BETA diff --git a/src/main/java/br/com/correios/BooleanStringfier.java b/src/main/java/br/com/correios/BooleanStringfier.java new file mode 100644 index 0000000..f9c49c0 --- /dev/null +++ b/src/main/java/br/com/correios/BooleanStringfier.java @@ -0,0 +1,41 @@ +package br.com.correios; + +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; + +public class BooleanStringfier { + + private TipoBooleanStringfier booleanToStringType; + + public BooleanStringfier(TipoBooleanStringfier booleanToStringType) { + this.booleanToStringType = booleanToStringType; + } + + public enum TipoBooleanStringfier { + S_OU_N("S", "N"); + + private final String trueString; + private final String falseString; + + private TipoBooleanStringfier(String trueString, String falseString) { + this.trueString = trueString; + this.falseString = falseString; + } + + private boolean convertToBoolean(String text) { + return BooleanUtils.toBoolean(text, trueString, falseString); + } + + private String convertToString(boolean flag) { + return BooleanUtils.toString(flag, trueString, falseString); + } + } + + public String convertToString(boolean flag) { + return booleanToStringType.convertToString(flag); + } + + public boolean convertToBoolean(String text) { + return booleanToStringType.convertToBoolean(StringUtils.defaultIfBlank(text, booleanToStringType.falseString)); + } +} diff --git a/src/main/java/br/com/correios/Cep.java b/src/main/java/br/com/correios/Cep.java new file mode 100644 index 0000000..e381f2c --- /dev/null +++ b/src/main/java/br/com/correios/Cep.java @@ -0,0 +1,26 @@ +package br.com.correios; + +import java.util.regex.Pattern; + +/** + * Classe que representa o CEP
+ * Sua formatacao deve ser de apenas 8 numeros. Ex: 99999999 + * + * @since 0.0.17-BETA + */ +public class Cep { + + private final String value; + + public Cep(String value) { + if (!Pattern.matches("\\d{8}", value)) { + throw new IllegalArgumentException("O cep deve estar formatado somente com 8 numeros"); + } + + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/src/main/java/br/com/correios/api/CorreiosApi.java b/src/main/java/br/com/correios/api/CorreiosApi.java index e23d0c8..64025c4 100644 --- a/src/main/java/br/com/correios/api/CorreiosApi.java +++ b/src/main/java/br/com/correios/api/CorreiosApi.java @@ -1,5 +1,6 @@ package br.com.correios.api; +import br.com.correios.api.estimativa.CorreiosEstimativaAPI; import br.com.correios.api.etiqueta.CorreiosEtiquetaApi; import br.com.correios.api.postagem.CorreiosPostagemApi; import br.com.correios.api.rastreio.service.CorreiosRastreioApi; @@ -13,24 +14,31 @@ public class CorreiosApi { /** - * API de rastreio de pacotes pelos seus respectivos codigos de rastreio. + * @return API de rastreio de pacotes pelos seus respectivos codigos de rastreio. */ public CorreiosRastreioApi rastreios(CorreiosCredenciais credenciais) { return new CorreiosRastreioApi(credenciais); } /** - * API de solicitacao de etiquetas. + * @return API de solicitacao de etiquetas. */ public CorreiosEtiquetaApi etiquetas(CorreiosCredenciais credenciais) { return new CorreiosEtiquetaApi(credenciais); } /** - * API de detalhes de uma postagem(PLP). + * @return API de detalhes de uma postagem(PLP). */ public CorreiosPostagemApi postagens(CorreiosCredenciais credenciais) { return new CorreiosPostagemApi(credenciais); } + /** + * @return API de calculo de estimativas contendo precos e prazos + */ + public CorreiosEstimativaAPI estimativas(CorreiosCredenciais credenciais) { + return new CorreiosEstimativaAPI(credenciais); + } + } diff --git a/src/main/java/br/com/correios/api/estimativa/CorreiosEstimativaAPI.java b/src/main/java/br/com/correios/api/estimativa/CorreiosEstimativaAPI.java new file mode 100644 index 0000000..a051a49 --- /dev/null +++ b/src/main/java/br/com/correios/api/estimativa/CorreiosEstimativaAPI.java @@ -0,0 +1,42 @@ +package br.com.correios.api.estimativa; + +import br.com.correios.credentials.CorreiosCredenciais; +import br.com.correios.estimativa.CResultadoToEstimativasConverter; +import br.com.correios.estimativa.CServicoToEstimativaComPrazoConverter; +import br.com.correios.estimativa.CServicoToEstimativaComPrecoEPrazoConverter; +import br.com.correios.estimativa.EstimativaComPrazo; +import br.com.correios.estimativa.EstimativaComPrecoEPrazo; +import br.com.correios.webservice.estimativa.CalcPrecoPrazoWS; + +/** + * Responsavel por chamar a API de estimativa do Correios para calcular + * precos e prazos + * + * @since 0.0.17-BETA + */ +public class CorreiosEstimativaAPI { + + private CorreiosServicoEstimativaAPI correiosServicoEstimativaAPI; + + public CorreiosEstimativaAPI(CorreiosCredenciais correiosCredenciais) { + CResultadoToEstimativasConverter precoEPrazoConverter = new CResultadoToEstimativasConverter<>(new CServicoToEstimativaComPrecoEPrazoConverter()); + CResultadoToEstimativasConverter prazoConverter = new CResultadoToEstimativasConverter<>(new CServicoToEstimativaComPrazoConverter()); + + this.correiosServicoEstimativaAPI = new SoapCorreiosServicoEstimativaAPI(new CalcPrecoPrazoWS(), correiosCredenciais, precoEPrazoConverter, prazoConverter); + } + + /** + * @return Um builder para montar a requisicao para calcular preco e prazo + */ + public RequisicaoEstimativaDePrecoEPrazoBuilder estimaPrecoEPrazo() { + return new RequisicaoEstimativaDePrecoEPrazoBuilder(correiosServicoEstimativaAPI); + } + + /** + * @return Um builder para montar a requisicao para calcular somente prazo + */ + public RequisicaoEstimativaDePrazoBuilder estimaPrazo() { + return new RequisicaoEstimativaDePrazoBuilder(correiosServicoEstimativaAPI); + } + +} diff --git a/src/main/java/br/com/correios/api/estimativa/CorreiosServicoEstimativaAPI.java b/src/main/java/br/com/correios/api/estimativa/CorreiosServicoEstimativaAPI.java new file mode 100644 index 0000000..710840a --- /dev/null +++ b/src/main/java/br/com/correios/api/estimativa/CorreiosServicoEstimativaAPI.java @@ -0,0 +1,28 @@ +package br.com.correios.api.estimativa; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Set; + +import br.com.correios.Cep; +import br.com.correios.estimativa.DimensoesPacoteEstimado; +import br.com.correios.estimativa.EstimativaComPrazo; +import br.com.correios.estimativa.EstimativaComPrecoEPrazo; + +/** + * Servico responsavel por acessar o servico do Correios + * + * @since 0.0.17-BETA + */ +public interface CorreiosServicoEstimativaAPI { + + /** + * @return estimativas com preco e prazo + */ + List calculaPrecoEPrazo(Set codigosServico, Cep cepOrigem, Cep cepDestino, DimensoesPacoteEstimado dimensoesPacoteEstimado, BigDecimal valorDeclarado, boolean adicionaServicoMaoPropria, boolean adicionaServicoAvisoRecebimento); + + /** + * @return estimativas somente com prazo + */ + List calculaPrazo(Set codigosServico, Cep cepOrigem, Cep cepDestino); +} diff --git a/src/main/java/br/com/correios/api/estimativa/RequisicaoEstimativaDePrazoBuilder.java b/src/main/java/br/com/correios/api/estimativa/RequisicaoEstimativaDePrazoBuilder.java new file mode 100644 index 0000000..2722f09 --- /dev/null +++ b/src/main/java/br/com/correios/api/estimativa/RequisicaoEstimativaDePrazoBuilder.java @@ -0,0 +1,79 @@ +package br.com.correios.api.estimativa; + +import java.util.List; +import java.util.Set; + +import com.google.common.collect.Sets; + +import br.com.correios.Cep; +import br.com.correios.estimativa.EstimativaComPrazo; + +/** + * Builder para construir a requisicao para estimativa de prazo. + * + * @since 0.0.17-BETA + */ +public class RequisicaoEstimativaDePrazoBuilder { + + private CorreiosServicoEstimativaAPI correiosServicoEstimativaAPI; + private Set codigosServico; + private Cep cepOrigem; + private Cep cepDestino; + + RequisicaoEstimativaDePrazoBuilder(CorreiosServicoEstimativaAPI correiosServicoEstimativaAPI) { + this.correiosServicoEstimativaAPI = correiosServicoEstimativaAPI; + } + + /** + * Informa o CEP de origem + */ + public RequisicaoEstimativaDePrazoComCepOrigem de(Cep cepOrigem) { + this.cepOrigem = cepOrigem; + return new RequisicaoEstimativaDePrazoComCepOrigem(this); + } + + public class RequisicaoEstimativaDePrazoComCepOrigem { + + private RequisicaoEstimativaDePrazoBuilder requisicaoEstimativaDePrazoBuilder; + + private RequisicaoEstimativaDePrazoComCepOrigem(RequisicaoEstimativaDePrazoBuilder requisicaoEstimativaDePrazoBuilder) { + this.requisicaoEstimativaDePrazoBuilder = requisicaoEstimativaDePrazoBuilder; + } + + /** + * Informa o CEP de destino + */ + public RequisicaoEstimativaDePrazoComCepDestino para(Cep cepDestino) { + requisicaoEstimativaDePrazoBuilder.cepDestino = cepDestino; + return new RequisicaoEstimativaDePrazoComCepDestino(requisicaoEstimativaDePrazoBuilder); + } + } + + public class RequisicaoEstimativaDePrazoComCepDestino { + + private RequisicaoEstimativaDePrazoBuilder requisicaoEstimativaDePrazoBuilder; + + private RequisicaoEstimativaDePrazoComCepDestino(RequisicaoEstimativaDePrazoBuilder requisicaoEstimativaDePrazoBuilder) { + this.requisicaoEstimativaDePrazoBuilder = requisicaoEstimativaDePrazoBuilder; + } + + /** + * Informa os codigos dos servicos que serao calculados + */ + public RequisicaoEstimativaDePrazoComServico comServicos(String...codigosServico) { + requisicaoEstimativaDePrazoBuilder.codigosServico = Sets.newHashSet(codigosServico); + return new RequisicaoEstimativaDePrazoComServico(); + } + } + + public class RequisicaoEstimativaDePrazoComServico { + + /** + * @return as estimativas calculadas somente com prazo + */ + public List calcula() { + return correiosServicoEstimativaAPI.calculaPrazo(codigosServico, cepOrigem, cepDestino); + } + + } +} diff --git a/src/main/java/br/com/correios/api/estimativa/RequisicaoEstimativaDePrecoEPrazoBuilder.java b/src/main/java/br/com/correios/api/estimativa/RequisicaoEstimativaDePrecoEPrazoBuilder.java new file mode 100644 index 0000000..7b0962c --- /dev/null +++ b/src/main/java/br/com/correios/api/estimativa/RequisicaoEstimativaDePrecoEPrazoBuilder.java @@ -0,0 +1,178 @@ +package br.com.correios.api.estimativa; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Set; + +import com.google.common.collect.Sets; + +import br.com.correios.Cep; +import br.com.correios.estimativa.DimensoesPacoteEstimado; +import br.com.correios.estimativa.EstimativaComPrecoEPrazo; + +/** + * Builder para construir a requisicao para estimativa de preco e prazo. + * + * @since 0.0.17-BETA + */ +public class RequisicaoEstimativaDePrecoEPrazoBuilder { + + private CorreiosServicoEstimativaAPI correiosServicoEstimativaAPI; + private Set codigosServico; + private Cep cepOrigem; + private Cep cepDestino; + private DimensoesPacoteEstimado dimensoesPacoteEstimado; + private BigDecimal valorDeclarado; + private boolean adicionaServicoMaoPropria; + private boolean adicionaServicoAvisoRecebimento; + + RequisicaoEstimativaDePrecoEPrazoBuilder(CorreiosServicoEstimativaAPI correiosServicoEstimativaAPI) { + this.correiosServicoEstimativaAPI = correiosServicoEstimativaAPI; + this.adicionaServicoMaoPropria = false; + this.adicionaServicoAvisoRecebimento = false; + } + + /** + * Informa o CEP de origem + */ + public RequisicaoEstimativaDePrecoEPrazoComCepOrigem de(Cep cepOrigem) { + this.cepOrigem = cepOrigem; + return new RequisicaoEstimativaDePrecoEPrazoComCepOrigem(this); + } + + public class RequisicaoEstimativaDePrecoEPrazoComCepOrigem { + + private RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder; + + private RequisicaoEstimativaDePrecoEPrazoComCepOrigem(RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder) { + this.requisicaoEstimativaDePrecoEPrazoBuilder = requisicaoEstimativaDePrecoEPrazoBuilder; + } + + /** + * Informa o CEP de destino + */ + public RequisicaoEstimativaDePrecoEPrazoComCepDestino para(Cep cepDestino) { + requisicaoEstimativaDePrecoEPrazoBuilder.cepDestino = cepDestino; + return new RequisicaoEstimativaDePrecoEPrazoComCepDestino(requisicaoEstimativaDePrecoEPrazoBuilder); + } + } + + public class RequisicaoEstimativaDePrecoEPrazoComCepDestino { + + private RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder; + + private RequisicaoEstimativaDePrecoEPrazoComCepDestino(RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder) { + this.requisicaoEstimativaDePrecoEPrazoBuilder = requisicaoEstimativaDePrecoEPrazoBuilder; + } + + /** + * Informa os codigos dos servicos que serao calculados + */ + public RequisicaoEstimativaDePrecoEPrazoComServico comServicos(String...codigosServico) { + requisicaoEstimativaDePrecoEPrazoBuilder.codigosServico = Sets.newHashSet(codigosServico); + return new RequisicaoEstimativaDePrecoEPrazoComServico(requisicaoEstimativaDePrecoEPrazoBuilder); + } + } + + public class RequisicaoEstimativaDePrecoEPrazoComServico { + + private RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder; + + private RequisicaoEstimativaDePrecoEPrazoComServico(RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder) { + this.requisicaoEstimativaDePrecoEPrazoBuilder = requisicaoEstimativaDePrecoEPrazoBuilder; + } + + /** + * Informa as dimensoes do pacote a ser estimado + */ + public RequisicaoEstimativaDePrecoEPrazoComDimensoesDoPacote comDimensoesDePacote(DimensoesPacoteEstimado dimensoesPacoteEstimado) { + requisicaoEstimativaDePrecoEPrazoBuilder.dimensoesPacoteEstimado = dimensoesPacoteEstimado; + return new RequisicaoEstimativaDePrecoEPrazoComDimensoesDoPacote(requisicaoEstimativaDePrecoEPrazoBuilder); + } + } + + + public class RequisicaoEstimativaDePrecoEPrazoComDimensoesDoPacote { + + private RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder; + + private RequisicaoEstimativaDePrecoEPrazoComDimensoesDoPacote(RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder) { + this.requisicaoEstimativaDePrecoEPrazoBuilder = requisicaoEstimativaDePrecoEPrazoBuilder; + } + + /** + * Informa o valor declarado do objeto que fara parte da encomenda. + * Esse valor interfere no calculo porque serve como base do calculo do seguro da encomenda + */ + public RequisicaoEstimativaDePrecoEPrazoComValorDeclarado comValorDeclarado(BigDecimal valorDeclarado) { + requisicaoEstimativaDePrecoEPrazoBuilder.valorDeclarado = valorDeclarado; + return new RequisicaoEstimativaDePrecoEPrazoComValorDeclarado(requisicaoEstimativaDePrecoEPrazoBuilder); + } + } + + public class RequisicaoEstimativaDePrecoEPrazoComValorDeclarado { + + private RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder; + + private RequisicaoEstimativaDePrecoEPrazoComValorDeclarado(RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder) { + this.requisicaoEstimativaDePrecoEPrazoBuilder = requisicaoEstimativaDePrecoEPrazoBuilder; + } + + /** + * Indica se a encomenda sera entregue com o servico adicional mao propria. + */ + public RequisicaoEstimativaDePrecoEPrazoComServicoMaoPropria adicionandoServicoMaoPropria() { + requisicaoEstimativaDePrecoEPrazoBuilder.adicionaServicoMaoPropria = true; + return new RequisicaoEstimativaDePrecoEPrazoComServicoMaoPropria(requisicaoEstimativaDePrecoEPrazoBuilder); + } + + /** + * Indica se a encomenda sera entregue com o servico adicional aviso de recebimento. + */ + public RequisicaoEstimativaDePrecoEPrazoComServicoAvisoDeRecebimento adicionandoServicoAvisoDeRecebimento() { + requisicaoEstimativaDePrecoEPrazoBuilder.adicionaServicoAvisoRecebimento = true; + return new RequisicaoEstimativaDePrecoEPrazoComServicoAvisoDeRecebimento(); + } + + /** + * @return as estimativas calculadas com preco e prazo + */ + public List calcula() { + return correiosServicoEstimativaAPI.calculaPrecoEPrazo(codigosServico, cepOrigem, cepDestino, dimensoesPacoteEstimado, valorDeclarado, adicionaServicoMaoPropria, adicionaServicoAvisoRecebimento); + } + } + + public class RequisicaoEstimativaDePrecoEPrazoComServicoMaoPropria { + + private RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder; + + private RequisicaoEstimativaDePrecoEPrazoComServicoMaoPropria(RequisicaoEstimativaDePrecoEPrazoBuilder requisicaoEstimativaDePrecoEPrazoBuilder) { + this.requisicaoEstimativaDePrecoEPrazoBuilder = requisicaoEstimativaDePrecoEPrazoBuilder; + } + + /** + * Indica se a encomenda sera entregue com o servico adicional aviso de recebimento. + */ + public RequisicaoEstimativaDePrecoEPrazoComServicoAvisoDeRecebimento adicionandoServicoAvisoDeRecebimento() { + requisicaoEstimativaDePrecoEPrazoBuilder.adicionaServicoAvisoRecebimento = true; + return new RequisicaoEstimativaDePrecoEPrazoComServicoAvisoDeRecebimento(); + } + + /** + * @return as estimativas calculadas com preco e prazo + */ + public List calcula() { + return correiosServicoEstimativaAPI.calculaPrecoEPrazo(codigosServico, cepOrigem, cepDestino, dimensoesPacoteEstimado, valorDeclarado, adicionaServicoMaoPropria, adicionaServicoAvisoRecebimento); + } + } + + public class RequisicaoEstimativaDePrecoEPrazoComServicoAvisoDeRecebimento { + + /** + * @return as estimativas calculadas com preco e prazo + */ + public List calcula() { + return correiosServicoEstimativaAPI.calculaPrecoEPrazo(codigosServico, cepOrigem, cepDestino, dimensoesPacoteEstimado, valorDeclarado, adicionaServicoMaoPropria, adicionaServicoAvisoRecebimento); + } + } +} diff --git a/src/main/java/br/com/correios/api/estimativa/SoapCorreiosServicoEstimativaAPI.java b/src/main/java/br/com/correios/api/estimativa/SoapCorreiosServicoEstimativaAPI.java new file mode 100644 index 0000000..6b0722d --- /dev/null +++ b/src/main/java/br/com/correios/api/estimativa/SoapCorreiosServicoEstimativaAPI.java @@ -0,0 +1,69 @@ +package br.com.correios.api.estimativa; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Set; + +import org.apache.commons.lang3.StringUtils; + +import br.com.correios.BooleanStringfier; +import br.com.correios.BooleanStringfier.TipoBooleanStringfier; +import br.com.correios.Cep; +import br.com.correios.credentials.CorreiosCredenciais; +import br.com.correios.estimativa.CResultadoToEstimativasConverter; +import br.com.correios.estimativa.DimensoesPacoteEstimado; +import br.com.correios.estimativa.EstimativaComPrazo; +import br.com.correios.estimativa.EstimativaComPrecoEPrazo; +import br.com.correios.webservice.estimativa.CResultado; +import br.com.correios.webservice.estimativa.CalcPrecoPrazoWS; +import br.com.correios.webservice.estimativa.CalcPrecoPrazoWSSoap; + +class SoapCorreiosServicoEstimativaAPI implements CorreiosServicoEstimativaAPI { + + private CorreiosCredenciais correiosCredenciais; + private CResultadoToEstimativasConverter precoEPrazoConverter; + private CResultadoToEstimativasConverter prazoConverter; + private CalcPrecoPrazoWS calcPrecoPrazoWS; + + SoapCorreiosServicoEstimativaAPI(CalcPrecoPrazoWS calcPrecoPrazoWS, CorreiosCredenciais correiosCredenciais, CResultadoToEstimativasConverter precoEPrazoConverter, CResultadoToEstimativasConverter prazoConverter) { + this.calcPrecoPrazoWS = calcPrecoPrazoWS; + this.correiosCredenciais = correiosCredenciais; + this.precoEPrazoConverter = precoEPrazoConverter; + this.prazoConverter = prazoConverter; + } + + @Override + public List calculaPrecoEPrazo(Set codigosServico, Cep cepOrigem, Cep cepDestino, DimensoesPacoteEstimado dimensoesPacoteEstimado, BigDecimal valorDeclarado, boolean adicionaServicoMaoPropria, boolean adicionaServicoAvisoRecebimento) { + CalcPrecoPrazoWSSoap calcPrecoPrazoWSSoap = calcPrecoPrazoWS.getCalcPrecoPrazoWSSoap(); + + BooleanStringfier booleanStringfier = new BooleanStringfier(TipoBooleanStringfier.S_OU_N); + + CResultado cResultado = calcPrecoPrazoWSSoap.calcPrecoPrazo(correiosCredenciais.getUsuario(), + correiosCredenciais.getSenha(), + StringUtils.join(codigosServico, ','), + cepOrigem.value(), + cepDestino.value(), + dimensoesPacoteEstimado.getPeso().toString(), + dimensoesPacoteEstimado.getTipoDoObjetoSendoEnviado().getCodigoInternoParaEstimativa(), + dimensoesPacoteEstimado.getComprimento(), + dimensoesPacoteEstimado.getAltura(), + dimensoesPacoteEstimado.getLargura(), + dimensoesPacoteEstimado.getDiametro(), + booleanStringfier.convertToString(adicionaServicoMaoPropria), + valorDeclarado, + booleanStringfier.convertToString(adicionaServicoAvisoRecebimento)); + + return precoEPrazoConverter.convert(cResultado); + } + + @Override + public List calculaPrazo(Set codigosServico, Cep cepOrigem, Cep cepDestino) { + CalcPrecoPrazoWSSoap calcPrecoPrazoWSSoap = calcPrecoPrazoWS.getCalcPrecoPrazoWSSoap(); + + String[] codigosServicoArray = codigosServico.toArray(new String[codigosServico.size()]); + CResultado cResultado = calcPrecoPrazoWSSoap.calcPrazo(StringUtils.join(codigosServicoArray, ','), cepOrigem.value(), cepDestino.value()); + + return prazoConverter.convert(cResultado); + } + +} diff --git a/src/main/java/br/com/correios/api/postagem/dimensao/DimensoesDoObjeto.java b/src/main/java/br/com/correios/api/postagem/dimensao/DimensoesDoObjeto.java index ed9bc88..5e84614 100644 --- a/src/main/java/br/com/correios/api/postagem/dimensao/DimensoesDoObjeto.java +++ b/src/main/java/br/com/correios/api/postagem/dimensao/DimensoesDoObjeto.java @@ -77,18 +77,24 @@ public class DimensoesDoObjeto { private int diametro; public enum TipoDoObjetoSendoEnviado { - ENVELOPE("1"), PACOTE_OU_CAIXA("2"), ROLO_OU_CILINDRO("3"); + ENVELOPE("1", 3), PACOTE_OU_CAIXA("2", 1), ROLO_OU_CILINDRO("3", 2); private String codigoInternoDosCorreios; + private int codigoInternoParaEstimativa; - TipoDoObjetoSendoEnviado(String codigoInternoDosCorreios) { + TipoDoObjetoSendoEnviado(String codigoInternoDosCorreios, int codigoInternoParaEstimativa) { this.codigoInternoDosCorreios = codigoInternoDosCorreios; + this.codigoInternoParaEstimativa = codigoInternoParaEstimativa; } public String getCodigoInternoDosCorreios() { return codigoInternoDosCorreios; } + public int getCodigoInternoParaEstimativa() { + return codigoInternoParaEstimativa; + } + public static TipoDoObjetoSendoEnviado getTipoDoObjetoAPartirDoCodigo(String codigoInternoDosCorreios) { if (ENVELOPE.codigoInternoDosCorreios.equals(codigoInternoDosCorreios)) { return ENVELOPE; diff --git a/src/main/java/br/com/correios/estimativa/CResultadoToEstimativasConverter.java b/src/main/java/br/com/correios/estimativa/CResultadoToEstimativasConverter.java new file mode 100644 index 0000000..04c5c9e --- /dev/null +++ b/src/main/java/br/com/correios/estimativa/CResultadoToEstimativasConverter.java @@ -0,0 +1,29 @@ +package br.com.correios.estimativa; + +import java.util.LinkedList; +import java.util.List; + +import br.com.correios.api.converter.Converter; +import br.com.correios.webservice.estimativa.CResultado; +import br.com.correios.webservice.estimativa.CServico; + +public class CResultadoToEstimativasConverter implements Converter> { + + private Converter precoPrazoConverter; + + public CResultadoToEstimativasConverter(Converter precoPrazoConverter) { + this.precoPrazoConverter = precoPrazoConverter; + } + + @Override + public List convert(CResultado cResultado) { + List estimativas = new LinkedList<>(); + + for (CServico servico : cResultado.getServicos().getCServico()) { + estimativas.add(precoPrazoConverter.convert(servico)); + } + + return estimativas; + } + +} diff --git a/src/main/java/br/com/correios/estimativa/CServicoToEstimativaComPrazoConverter.java b/src/main/java/br/com/correios/estimativa/CServicoToEstimativaComPrazoConverter.java new file mode 100644 index 0000000..2901c26 --- /dev/null +++ b/src/main/java/br/com/correios/estimativa/CServicoToEstimativaComPrazoConverter.java @@ -0,0 +1,29 @@ +package br.com.correios.estimativa; + +import org.apache.commons.lang3.StringUtils; + +import br.com.correios.BooleanStringfier; +import br.com.correios.BooleanStringfier.TipoBooleanStringfier; +import br.com.correios.api.converter.Converter; +import br.com.correios.webservice.estimativa.CServico; + +public class CServicoToEstimativaComPrazoConverter implements Converter { + + private static final int TAMANHO_CODIGO_SERVICO = 5; + + @Override + public EstimativaComPrazo convert(CServico servico) { + EstimativaComPrazo estimativa = new EstimativaComPrazo(); + BooleanStringfier booleanStringfier = new BooleanStringfier(TipoBooleanStringfier.S_OU_N); + + estimativa.setCodigoServico(StringUtils.leftPad(String.valueOf(servico.getCodigo()), TAMANHO_CODIGO_SERVICO, "0")); + estimativa.setPrazoEntrega(Integer.valueOf(servico.getPrazoEntrega())); + estimativa.setEntregaDomiciliar(booleanStringfier.convertToBoolean(servico.getEntregaDomiciliar())); + estimativa.setEntregaAosSabados(booleanStringfier.convertToBoolean(servico.getEntregaSabado())); + estimativa.setCodigoErro(servico.getErro()); + estimativa.setMensagemErro(servico.getMsgErro()); + + return estimativa; + } + +} diff --git a/src/main/java/br/com/correios/estimativa/CServicoToEstimativaComPrecoEPrazoConverter.java b/src/main/java/br/com/correios/estimativa/CServicoToEstimativaComPrecoEPrazoConverter.java new file mode 100644 index 0000000..197f5cb --- /dev/null +++ b/src/main/java/br/com/correios/estimativa/CServicoToEstimativaComPrecoEPrazoConverter.java @@ -0,0 +1,34 @@ +package br.com.correios.estimativa; + +import org.apache.commons.lang3.StringUtils; + +import br.com.correios.BooleanStringfier; +import br.com.correios.BooleanStringfier.TipoBooleanStringfier; +import br.com.correios.api.converter.Converter; +import br.com.correios.webservice.estimativa.CServico; + +public class CServicoToEstimativaComPrecoEPrazoConverter implements Converter { + + private static final int TAMANHO_CODIGO_SERVICO = 5; + + @Override + public EstimativaComPrecoEPrazo convert(CServico servico) { + EstimativaComPrecoEPrazo estimativa = new EstimativaComPrecoEPrazo(); + BooleanStringfier booleanStringfier = new BooleanStringfier(TipoBooleanStringfier.S_OU_N); + + estimativa.setCodigoServico(StringUtils.leftPad(String.valueOf(servico.getCodigo()), TAMANHO_CODIGO_SERVICO, "0")); + estimativa.setPrazoEntrega(Integer.valueOf(servico.getPrazoEntrega())); + estimativa.setValor(servico.getValor()); + estimativa.setValorServicoAvisoDeRecebimento(servico.getValorAvisoRecebimento()); + estimativa.setValorSeguro(servico.getValorValorDeclarado()); + estimativa.setValorServicoMaoPropria(servico.getValorMaoPropria()); + estimativa.setValorSemAdicionais(servico.getValorSemAdicionais()); + estimativa.setEntregaDomiciliar(booleanStringfier.convertToBoolean(servico.getEntregaDomiciliar())); + estimativa.setEntregaAosSabados(booleanStringfier.convertToBoolean(servico.getEntregaSabado())); + estimativa.setCodigoErro(servico.getErro()); + estimativa.setMensagemErro(servico.getMsgErro()); + + return estimativa; + } + +} diff --git a/src/main/java/br/com/correios/estimativa/DimensoesPacoteEstimado.java b/src/main/java/br/com/correios/estimativa/DimensoesPacoteEstimado.java new file mode 100644 index 0000000..30636b6 --- /dev/null +++ b/src/main/java/br/com/correios/estimativa/DimensoesPacoteEstimado.java @@ -0,0 +1,147 @@ +package br.com.correios.estimativa; + +import java.math.BigDecimal; + +import br.com.correios.api.postagem.dimensao.DimensoesDoObjeto.TipoDoObjetoSendoEnviado; + +/** + * Classe que representa as dimensoes de um pacote a ser estimado + * + * @since 0.0.17-BETA + */ +public class DimensoesPacoteEstimado { + + /** + * Formato da encomenda (incluindo embalagem) + */ + private TipoDoObjetoSendoEnviado tipoDoObjetoSendoEnviado; + + /** + * Peso da encomenda, incluindo sua embalagem. + * O peso deve ser informado em quilogramas. + * Se o formato for Envelope, o valor maximo permitido sera 1 kg. + * + * @see {@link TipoDoObjetoSendoEnviado} + */ + private BigDecimal peso; + + /** + * Comprimento da encomenda (incluindo embalagem), em centimetros. + */ + private BigDecimal comprimento; + + /** + * Altura da encomenda (incluindo embalagem), em centimetros. + * Se o formato for envelope, informar zero (0). + */ + private BigDecimal altura; + + /** + * Largura da encomenda (incluindo embalagem), em centimetros. + */ + private BigDecimal largura; + + /** + * Diametro da encomenda (incluindo embalagem), em centimetros. + */ + private BigDecimal diametro; + + // Construtor privado para obrigar o uso do builder + private DimensoesPacoteEstimado() { + this.diametro = BigDecimal.ZERO; + } + + public static DimensoesPacoteEstimadoBuilder builder() { + return new DimensoesPacoteEstimadoBuilder(); + } + + public static class DimensoesPacoteEstimadoBuilder { + + private DimensoesPacoteEstimado dimensoesPacoteEstimado; + + public DimensoesPacoteEstimadoBuilder() { + this.dimensoesPacoteEstimado = new DimensoesPacoteEstimado(); + } + + public DimensoesPacoteEstimadoComTipoDeObjeto comTipoDeObjeto(TipoDoObjetoSendoEnviado tipoDoObjetoSendoEnviado) { + dimensoesPacoteEstimado.tipoDoObjetoSendoEnviado = tipoDoObjetoSendoEnviado; + return new DimensoesPacoteEstimadoComTipoDeObjeto(); + } + + public class DimensoesPacoteEstimadoComTipoDeObjeto { + + public DimensoesPacoteEstimadoComPeso comPeso(BigDecimal peso) { + dimensoesPacoteEstimado.peso = peso; + return new DimensoesPacoteEstimadoComPeso(); + } + } + + public class DimensoesPacoteEstimadoComPeso { + + public DimensoesPacoteEstimadoComComprimento comComprimento(BigDecimal comprimento) { + dimensoesPacoteEstimado.comprimento = comprimento; + return new DimensoesPacoteEstimadoComComprimento(); + } + } + + public class DimensoesPacoteEstimadoComComprimento { + + public DimensoesPacoteEstimadoComAltura comAltura(BigDecimal altura) { + dimensoesPacoteEstimado.altura = altura; + return new DimensoesPacoteEstimadoComAltura(); + } + } + + public class DimensoesPacoteEstimadoComAltura { + + public DimensoesPacoteEstimadoComLargura comLargura(BigDecimal largura) { + dimensoesPacoteEstimado.largura = largura; + return new DimensoesPacoteEstimadoComLargura(); + } + } + + public class DimensoesPacoteEstimadoComLargura { + + public DimensoesPacoteEstimado montaDimensoes() { + return dimensoesPacoteEstimado; + } + + public DimensoesPacoteEstimadoComDiametro comDiametro(BigDecimal diametro) { + dimensoesPacoteEstimado.diametro = diametro; + return new DimensoesPacoteEstimadoComDiametro(); + } + } + + public class DimensoesPacoteEstimadoComDiametro { + + public DimensoesPacoteEstimado montaDimensoes() { + return dimensoesPacoteEstimado; + } + } + } + + public TipoDoObjetoSendoEnviado getTipoDoObjetoSendoEnviado() { + return tipoDoObjetoSendoEnviado; + } + + public BigDecimal getPeso() { + return peso; + } + + public BigDecimal getComprimento() { + return comprimento; + } + + public BigDecimal getAltura() { + return altura; + } + + public BigDecimal getLargura() { + return largura; + } + + public BigDecimal getDiametro() { + return diametro; + } + +} diff --git a/src/main/java/br/com/correios/estimativa/EstimativaComPrazo.java b/src/main/java/br/com/correios/estimativa/EstimativaComPrazo.java new file mode 100644 index 0000000..fb288fe --- /dev/null +++ b/src/main/java/br/com/correios/estimativa/EstimativaComPrazo.java @@ -0,0 +1,120 @@ +package br.com.correios.estimativa; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * Classe que representa uma estimativa calculada pelo servico do Correios + * que possui somente o prazo da encomenda + * + * @since 0.0.17-BETA + */ +public class EstimativaComPrazo { + + /** + * Codigo do Servico de Entrega. + */ + private String codigoServico; + + /** + * Prazo estimado em dias para entrega do produto. + * Se o valor retornado for 0 (zero), indica que o prazo nao foi retornado corretamente. + * Mas nesso modelo use {@link #isEstimativaValida()} para validar se a estimativa esta valida + */ + private Integer prazoEntrega; + + /** + * Informa se a localidade informada possui entrega domiciliaria. + * Se o prazo nao for retornado corretamente, o retorno deste parametro sera vazio. + */ + private boolean entregaDomiciliar; + + /** + * Informa se a localidade informada possui entrega domiciliaria aos sabados. + * Se o prazo nao for retornado corretamente, o retorno deste parametro sera vazio. + */ + private boolean entregaAosSabados; + + /** + * Codigo do Erro retornado pelo calculador + */ + private String codigoErro; + + /** + * Descricao do erro gerado. + */ + private String mensagemErro; + + public String getCodigoServico() { + return codigoServico; + } + + public void setCodigoServico(String codigoServico) { + this.codigoServico = codigoServico; + } + + public Integer getPrazoEntrega() { + return prazoEntrega; + } + + public void setPrazoEntrega(Integer prazoEntrega) { + this.prazoEntrega = prazoEntrega; + } + + public boolean isEntregaDomiciliar() { + return entregaDomiciliar; + } + + public void setEntregaDomiciliar(boolean entregaDomiciliar) { + this.entregaDomiciliar = entregaDomiciliar; + } + + public boolean isEntregaAosSabados() { + return entregaAosSabados; + } + + public void setEntregaAosSabados(boolean entregaAosSabados) { + this.entregaAosSabados = entregaAosSabados; + } + + public String getCodigoErro() { + return codigoErro; + } + + public void setCodigoErro(String codigoErro) { + this.codigoErro = codigoErro; + } + + public String getMensagemErro() { + return mensagemErro; + } + + public void setMensagemErro(String mensagemErro) { + this.mensagemErro = mensagemErro; + } + + /** + * @return se uma estimativa esta valida, ou seja, possui um prazo de entrega valido + */ + public boolean isEstimativaValida() { + return !temMensagemErro() || prazoEntrega != 0; + } + + /** + * @return Se uma estimativa possui uma mensagem de atencao, + * porem ainda esta valida + */ + public boolean possuiMensagemAtencao() { + return temMensagemErro() && prazoEntrega != 0; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } + + private boolean temMensagemErro() { + return StringUtils.isNotBlank(codigoErro) && !"0".equals(codigoErro); + } +} diff --git a/src/main/java/br/com/correios/estimativa/EstimativaComPrecoEPrazo.java b/src/main/java/br/com/correios/estimativa/EstimativaComPrecoEPrazo.java new file mode 100644 index 0000000..459f3ea --- /dev/null +++ b/src/main/java/br/com/correios/estimativa/EstimativaComPrecoEPrazo.java @@ -0,0 +1,189 @@ +package br.com.correios.estimativa; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import br.com.correios.api.estimativa.RequisicaoEstimativaDePrecoEPrazoBuilder.RequisicaoEstimativaDePrecoEPrazoComDimensoesDoPacote; + +/** + * Classe que representa uma estimativa calculada pelo servico do Correios + * que possui o preco e prazo da encomenda + * + * @since 0.0.17-BETA + */ +public class EstimativaComPrecoEPrazo { + + /** + * Codigo do Servico de Entrega. + */ + private String codigoServico; + + /** + * Preco total da encomenda, em Reais, incluindo os precos dos servicos opcionais + */ + private String valor; + + /** + * Prazo estimado em dias para entrega do produto. + * Se o valor retornado for 0 (zero), indica que o prazo nao foi retornado corretamente. + * Mas nesso modelo use {@link #isEstimativaValida()} para validar se a estimativa esta valida + */ + private Integer prazoEntrega; + + /** + * Preco do servico adicional Mao Propria + */ + private String valorServicoMaoPropria; + + /** + * Preco do servico adicional Aviso de Recebimento + */ + private String valorServicoAvisoDeRecebimento; + + /** + * Preco cobrado pelo Correios para assegurar o produto encomendado. + * Esse valor esta baseado no valor {@link RequisicaoEstimativaDePrecoEPrazoComDimensoesDoPacote#comValorDeclarado(java.math.BigDecimal)} + */ + private String valorSeguro; + + /** + * Informa se a localidade informada possui entrega domiciliaria. + * Se o prazo nao for retornado corretamente, o retorno deste parametro sera vazio. + */ + private boolean entregaDomiciliar; + + /** + * Informa se a localidade informada possui entrega domiciliaria aos sabados. + * Se o prazo nao for retornado corretamente, o retorno deste parametro sera vazio. + */ + private boolean entregaAosSabados; + + /** + * Preco da encomenda, sem adicionar os servicos adicionais como {@link #entregaDomiciliar} e {@link #entregaAosSabados} + */ + private String valorSemAdicionais; + + /** + * Codigo do Erro retornado pelo calculador + */ + private String codigoErro; + + /** + * Descricao do erro gerado. + */ + private String mensagemErro; + + public String getCodigoServico() { + return codigoServico; + } + + public void setCodigoServico(String codigoServico) { + this.codigoServico = codigoServico; + } + + public String getValor() { + return valor; + } + + public void setValor(String valor) { + this.valor = valor; + } + + public Integer getPrazoEntrega() { + return prazoEntrega; + } + + public void setPrazoEntrega(Integer prazoEntrega) { + this.prazoEntrega = prazoEntrega; + } + + public String getValorServicoMaoPropria() { + return valorServicoMaoPropria; + } + + public void setValorServicoMaoPropria(String valorServicoMaoPropria) { + this.valorServicoMaoPropria = valorServicoMaoPropria; + } + + public String getValorServicoAvisoDeRecebimento() { + return valorServicoAvisoDeRecebimento; + } + + public void setValorServicoAvisoDeRecebimento(String valorServicoAvisoDeRecebimento) { + this.valorServicoAvisoDeRecebimento = valorServicoAvisoDeRecebimento; + } + + public String getValorSeguro() { + return valorSeguro; + } + + public void setValorSeguro(String valorSeguro) { + this.valorSeguro = valorSeguro; + } + + public boolean isEntregaDomiciliar() { + return entregaDomiciliar; + } + + public void setEntregaDomiciliar(boolean entregaDomiciliar) { + this.entregaDomiciliar = entregaDomiciliar; + } + + public boolean isEntregaAosSabados() { + return entregaAosSabados; + } + + public void setEntregaAosSabados(boolean entregaAosSabados) { + this.entregaAosSabados = entregaAosSabados; + } + + public String getValorSemAdicionais() { + return valorSemAdicionais; + } + + public void setValorSemAdicionais(String valorSemAdicionais) { + this.valorSemAdicionais = valorSemAdicionais; + } + + public String getCodigoErro() { + return codigoErro; + } + + public void setCodigoErro(String codigoErro) { + this.codigoErro = codigoErro; + } + + public String getMensagemErro() { + return mensagemErro; + } + + public void setMensagemErro(String mensagemErro) { + this.mensagemErro = mensagemErro; + } + + /** + * @return se uma estimativa esta valida, ou seja, possui um prazo de entrega valido + */ + public boolean isEstimativaValida() { + return !temMensagemErro() || prazoEntrega != 0; + } + + /** + * @return Se uma estimativa possui uma mensagem de atencao, + * porem ainda esta valida + */ + public boolean possuiMensagemAtencao() { + return temMensagemErro() && prazoEntrega != 0; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } + + private boolean temMensagemErro() { + return StringUtils.isNotBlank(codigoErro) && !"0".equals(codigoErro); + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/ArrayOfCServico.class b/src/main/java/br/com/correios/webservice/estimativa/ArrayOfCServico.class new file mode 100644 index 0000000..e3eae68 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/ArrayOfCServico.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/ArrayOfCServico.java b/src/main/java/br/com/correios/webservice/estimativa/ArrayOfCServico.java new file mode 100644 index 0000000..8e45688 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/ArrayOfCServico.java @@ -0,0 +1,67 @@ + +package br.com.correios.webservice.estimativa; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ArrayOfCServico complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ArrayOfCServico">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="cServico" type="{http://tempuri.org/}cServico" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ArrayOfCServico", propOrder = { + "cServico" +}) +public class ArrayOfCServico { + + protected List cServico; + + /** + * Gets the value of the cServico property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the cServico property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCServico().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CServico } + * + * + */ + public List getCServico() { + if (cServico == null) { + cServico = new ArrayList(); + } + return this.cServico; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CResultado.class b/src/main/java/br/com/correios/webservice/estimativa/CResultado.class new file mode 100644 index 0000000..7298616 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CResultado.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CResultado.java b/src/main/java/br/com/correios/webservice/estimativa/CResultado.java new file mode 100644 index 0000000..34b4a65 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CResultado.java @@ -0,0 +1,62 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cResultado complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cResultado">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Servicos" type="{http://tempuri.org/}ArrayOfCServico" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cResultado", propOrder = { + "servicos" +}) +public class CResultado { + + @XmlElement(name = "Servicos") + protected ArrayOfCServico servicos; + + /** + * Gets the value of the servicos property. + * + * @return + * possible object is + * {@link ArrayOfCServico } + * + */ + public ArrayOfCServico getServicos() { + return servicos; + } + + /** + * Sets the value of the servicos property. + * + * @param value + * allowed object is + * {@link ArrayOfCServico } + * + */ + public void setServicos(ArrayOfCServico value) { + this.servicos = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CServico.class b/src/main/java/br/com/correios/webservice/estimativa/CServico.class new file mode 100644 index 0000000..6eeb66b Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CServico.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CServico.java b/src/main/java/br/com/correios/webservice/estimativa/CServico.java new file mode 100644 index 0000000..64c809e --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CServico.java @@ -0,0 +1,361 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cServico complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cServico">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Codigo" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="Valor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="PrazoEntrega" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ValorMaoPropria" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ValorAvisoRecebimento" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ValorValorDeclarado" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="EntregaDomiciliar" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="EntregaSabado" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="Erro" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="MsgErro" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ValorSemAdicionais" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="obsFim" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cServico", propOrder = { + "codigo", + "valor", + "prazoEntrega", + "valorMaoPropria", + "valorAvisoRecebimento", + "valorValorDeclarado", + "entregaDomiciliar", + "entregaSabado", + "erro", + "msgErro", + "valorSemAdicionais", + "obsFim" +}) +public class CServico { + + @XmlElement(name = "Codigo") + protected int codigo; + @XmlElement(name = "Valor") + protected String valor; + @XmlElement(name = "PrazoEntrega") + protected String prazoEntrega; + @XmlElement(name = "ValorMaoPropria") + protected String valorMaoPropria; + @XmlElement(name = "ValorAvisoRecebimento") + protected String valorAvisoRecebimento; + @XmlElement(name = "ValorValorDeclarado") + protected String valorValorDeclarado; + @XmlElement(name = "EntregaDomiciliar") + protected String entregaDomiciliar; + @XmlElement(name = "EntregaSabado") + protected String entregaSabado; + @XmlElement(name = "Erro") + protected String erro; + @XmlElement(name = "MsgErro") + protected String msgErro; + @XmlElement(name = "ValorSemAdicionais") + protected String valorSemAdicionais; + protected String obsFim; + + /** + * Gets the value of the codigo property. + * + */ + public int getCodigo() { + return codigo; + } + + /** + * Sets the value of the codigo property. + * + */ + public void setCodigo(int value) { + this.codigo = value; + } + + /** + * Gets the value of the valor property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValor() { + return valor; + } + + /** + * Sets the value of the valor property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValor(String value) { + this.valor = value; + } + + /** + * Gets the value of the prazoEntrega property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPrazoEntrega() { + return prazoEntrega; + } + + /** + * Sets the value of the prazoEntrega property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPrazoEntrega(String value) { + this.prazoEntrega = value; + } + + /** + * Gets the value of the valorMaoPropria property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValorMaoPropria() { + return valorMaoPropria; + } + + /** + * Sets the value of the valorMaoPropria property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValorMaoPropria(String value) { + this.valorMaoPropria = value; + } + + /** + * Gets the value of the valorAvisoRecebimento property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValorAvisoRecebimento() { + return valorAvisoRecebimento; + } + + /** + * Sets the value of the valorAvisoRecebimento property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValorAvisoRecebimento(String value) { + this.valorAvisoRecebimento = value; + } + + /** + * Gets the value of the valorValorDeclarado property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValorValorDeclarado() { + return valorValorDeclarado; + } + + /** + * Sets the value of the valorValorDeclarado property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValorValorDeclarado(String value) { + this.valorValorDeclarado = value; + } + + /** + * Gets the value of the entregaDomiciliar property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEntregaDomiciliar() { + return entregaDomiciliar; + } + + /** + * Sets the value of the entregaDomiciliar property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEntregaDomiciliar(String value) { + this.entregaDomiciliar = value; + } + + /** + * Gets the value of the entregaSabado property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEntregaSabado() { + return entregaSabado; + } + + /** + * Sets the value of the entregaSabado property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEntregaSabado(String value) { + this.entregaSabado = value; + } + + /** + * Gets the value of the erro property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getErro() { + return erro; + } + + /** + * Sets the value of the erro property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setErro(String value) { + this.erro = value; + } + + /** + * Gets the value of the msgErro property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMsgErro() { + return msgErro; + } + + /** + * Sets the value of the msgErro property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMsgErro(String value) { + this.msgErro = value; + } + + /** + * Gets the value of the valorSemAdicionais property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValorSemAdicionais() { + return valorSemAdicionais; + } + + /** + * Sets the value of the valorSemAdicionais property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValorSemAdicionais(String value) { + this.valorSemAdicionais = value; + } + + /** + * Gets the value of the obsFim property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getObsFim() { + return obsFim; + } + + /** + * Sets the value of the obsFim property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setObsFim(String value) { + this.obsFim = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazo.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazo.class new file mode 100644 index 0000000..bdb81c9 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazo.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazo.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazo.java new file mode 100644 index 0000000..7d805e1 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazo.java @@ -0,0 +1,116 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdServico", + "sCepOrigem", + "sCepDestino" +}) +@XmlRootElement(name = "CalcPrazo") +public class CalcPrazo { + + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoData.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoData.class new file mode 100644 index 0000000..9bed565 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoData.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoData.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoData.java new file mode 100644 index 0000000..58d7a91 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoData.java @@ -0,0 +1,143 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDtCalculo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdServico", + "sCepOrigem", + "sCepDestino", + "sDtCalculo" +}) +@XmlRootElement(name = "CalcPrazoData") +public class CalcPrazoData { + + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + protected String sDtCalculo; + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + + /** + * Gets the value of the sDtCalculo property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDtCalculo() { + return sDtCalculo; + } + + /** + * Sets the value of the sDtCalculo property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDtCalculo(String value) { + this.sDtCalculo = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoDataResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoDataResponse.class new file mode 100644 index 0000000..f669327 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoDataResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoDataResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoDataResponse.java new file mode 100644 index 0000000..64ffb85 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoDataResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrazoDataResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrazoDataResult" +}) +@XmlRootElement(name = "CalcPrazoDataResponse") +public class CalcPrazoDataResponse { + + @XmlElement(name = "CalcPrazoDataResult", required = true) + protected CResultado calcPrazoDataResult; + + /** + * Gets the value of the calcPrazoDataResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrazoDataResult() { + return calcPrazoDataResult; + } + + /** + * Sets the value of the calcPrazoDataResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrazoDataResult(CResultado value) { + this.calcPrazoDataResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoResponse.class new file mode 100644 index 0000000..2695bf4 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoResponse.java new file mode 100644 index 0000000..54f07db --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrazoResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrazoResult" +}) +@XmlRootElement(name = "CalcPrazoResponse") +public class CalcPrazoResponse { + + @XmlElement(name = "CalcPrazoResult", required = true) + protected CResultado calcPrazoResult; + + /** + * Gets the value of the calcPrazoResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrazoResult() { + return calcPrazoResult; + } + + /** + * Sets the value of the calcPrazoResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrazoResult(CResultado value) { + this.calcPrazoResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricao.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricao.class new file mode 100644 index 0000000..e8b1bf4 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricao.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricao.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricao.java new file mode 100644 index 0000000..f548d2b --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricao.java @@ -0,0 +1,143 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDtCalculo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdServico", + "sCepOrigem", + "sCepDestino", + "sDtCalculo" +}) +@XmlRootElement(name = "CalcPrazoRestricao") +public class CalcPrazoRestricao { + + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + protected String sDtCalculo; + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + + /** + * Gets the value of the sDtCalculo property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDtCalculo() { + return sDtCalculo; + } + + /** + * Sets the value of the sDtCalculo property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDtCalculo(String value) { + this.sDtCalculo = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricaoResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricaoResponse.class new file mode 100644 index 0000000..19dc2fc Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricaoResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricaoResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricaoResponse.java new file mode 100644 index 0000000..25a09f0 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrazoRestricaoResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrazoRestricaoResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrazoRestricaoResult" +}) +@XmlRootElement(name = "CalcPrazoRestricaoResponse") +public class CalcPrazoRestricaoResponse { + + @XmlElement(name = "CalcPrazoRestricaoResult", required = true) + protected CResultado calcPrazoRestricaoResult; + + /** + * Gets the value of the calcPrazoRestricaoResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrazoRestricaoResult() { + return calcPrazoRestricaoResult; + } + + /** + * Sets the value of the calcPrazoRestricaoResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrazoRestricaoResult(CResultado value) { + this.calcPrazoRestricaoResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPreco.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPreco.class new file mode 100644 index 0000000..34ab5f4 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPreco.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPreco.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPreco.java new file mode 100644 index 0000000..d7d76a9 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPreco.java @@ -0,0 +1,412 @@ + +package br.com.correios.webservice.estimativa; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdEmpresa" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDsSenha" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlPeso" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdFormato" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="nVlComprimento" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlAltura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlLargura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlDiametro" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdMaoPropria" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlValorDeclarado" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdAvisoRecebimento" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdEmpresa", + "sDsSenha", + "nCdServico", + "sCepOrigem", + "sCepDestino", + "nVlPeso", + "nCdFormato", + "nVlComprimento", + "nVlAltura", + "nVlLargura", + "nVlDiametro", + "sCdMaoPropria", + "nVlValorDeclarado", + "sCdAvisoRecebimento" +}) +@XmlRootElement(name = "CalcPreco") +public class CalcPreco { + + protected String nCdEmpresa; + protected String sDsSenha; + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + protected String nVlPeso; + protected int nCdFormato; + @XmlElement(required = true) + protected BigDecimal nVlComprimento; + @XmlElement(required = true) + protected BigDecimal nVlAltura; + @XmlElement(required = true) + protected BigDecimal nVlLargura; + @XmlElement(required = true) + protected BigDecimal nVlDiametro; + protected String sCdMaoPropria; + @XmlElement(required = true) + protected BigDecimal nVlValorDeclarado; + protected String sCdAvisoRecebimento; + + /** + * Gets the value of the nCdEmpresa property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdEmpresa() { + return nCdEmpresa; + } + + /** + * Sets the value of the nCdEmpresa property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdEmpresa(String value) { + this.nCdEmpresa = value; + } + + /** + * Gets the value of the sDsSenha property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDsSenha() { + return sDsSenha; + } + + /** + * Sets the value of the sDsSenha property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDsSenha(String value) { + this.sDsSenha = value; + } + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + + /** + * Gets the value of the nVlPeso property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNVlPeso() { + return nVlPeso; + } + + /** + * Sets the value of the nVlPeso property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNVlPeso(String value) { + this.nVlPeso = value; + } + + /** + * Gets the value of the nCdFormato property. + * + */ + public int getNCdFormato() { + return nCdFormato; + } + + /** + * Sets the value of the nCdFormato property. + * + */ + public void setNCdFormato(int value) { + this.nCdFormato = value; + } + + /** + * Gets the value of the nVlComprimento property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlComprimento() { + return nVlComprimento; + } + + /** + * Sets the value of the nVlComprimento property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlComprimento(BigDecimal value) { + this.nVlComprimento = value; + } + + /** + * Gets the value of the nVlAltura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlAltura() { + return nVlAltura; + } + + /** + * Sets the value of the nVlAltura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlAltura(BigDecimal value) { + this.nVlAltura = value; + } + + /** + * Gets the value of the nVlLargura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlLargura() { + return nVlLargura; + } + + /** + * Sets the value of the nVlLargura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlLargura(BigDecimal value) { + this.nVlLargura = value; + } + + /** + * Gets the value of the nVlDiametro property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlDiametro() { + return nVlDiametro; + } + + /** + * Sets the value of the nVlDiametro property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlDiametro(BigDecimal value) { + this.nVlDiametro = value; + } + + /** + * Gets the value of the sCdMaoPropria property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdMaoPropria() { + return sCdMaoPropria; + } + + /** + * Sets the value of the sCdMaoPropria property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdMaoPropria(String value) { + this.sCdMaoPropria = value; + } + + /** + * Gets the value of the nVlValorDeclarado property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlValorDeclarado() { + return nVlValorDeclarado; + } + + /** + * Sets the value of the nVlValorDeclarado property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlValorDeclarado(BigDecimal value) { + this.nVlValorDeclarado = value; + } + + /** + * Gets the value of the sCdAvisoRecebimento property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdAvisoRecebimento() { + return sCdAvisoRecebimento; + } + + /** + * Sets the value of the sCdAvisoRecebimento property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdAvisoRecebimento(String value) { + this.sCdAvisoRecebimento = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoData.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoData.class new file mode 100644 index 0000000..9c035f6 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoData.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoData.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoData.java new file mode 100644 index 0000000..aaaa62d --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoData.java @@ -0,0 +1,439 @@ + +package br.com.correios.webservice.estimativa; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdEmpresa" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDsSenha" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlPeso" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdFormato" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="nVlComprimento" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlAltura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlLargura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlDiametro" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdMaoPropria" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlValorDeclarado" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdAvisoRecebimento" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDtCalculo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdEmpresa", + "sDsSenha", + "nCdServico", + "sCepOrigem", + "sCepDestino", + "nVlPeso", + "nCdFormato", + "nVlComprimento", + "nVlAltura", + "nVlLargura", + "nVlDiametro", + "sCdMaoPropria", + "nVlValorDeclarado", + "sCdAvisoRecebimento", + "sDtCalculo" +}) +@XmlRootElement(name = "CalcPrecoData") +public class CalcPrecoData { + + protected String nCdEmpresa; + protected String sDsSenha; + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + protected String nVlPeso; + protected int nCdFormato; + @XmlElement(required = true) + protected BigDecimal nVlComprimento; + @XmlElement(required = true) + protected BigDecimal nVlAltura; + @XmlElement(required = true) + protected BigDecimal nVlLargura; + @XmlElement(required = true) + protected BigDecimal nVlDiametro; + protected String sCdMaoPropria; + @XmlElement(required = true) + protected BigDecimal nVlValorDeclarado; + protected String sCdAvisoRecebimento; + protected String sDtCalculo; + + /** + * Gets the value of the nCdEmpresa property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdEmpresa() { + return nCdEmpresa; + } + + /** + * Sets the value of the nCdEmpresa property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdEmpresa(String value) { + this.nCdEmpresa = value; + } + + /** + * Gets the value of the sDsSenha property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDsSenha() { + return sDsSenha; + } + + /** + * Sets the value of the sDsSenha property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDsSenha(String value) { + this.sDsSenha = value; + } + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + + /** + * Gets the value of the nVlPeso property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNVlPeso() { + return nVlPeso; + } + + /** + * Sets the value of the nVlPeso property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNVlPeso(String value) { + this.nVlPeso = value; + } + + /** + * Gets the value of the nCdFormato property. + * + */ + public int getNCdFormato() { + return nCdFormato; + } + + /** + * Sets the value of the nCdFormato property. + * + */ + public void setNCdFormato(int value) { + this.nCdFormato = value; + } + + /** + * Gets the value of the nVlComprimento property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlComprimento() { + return nVlComprimento; + } + + /** + * Sets the value of the nVlComprimento property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlComprimento(BigDecimal value) { + this.nVlComprimento = value; + } + + /** + * Gets the value of the nVlAltura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlAltura() { + return nVlAltura; + } + + /** + * Sets the value of the nVlAltura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlAltura(BigDecimal value) { + this.nVlAltura = value; + } + + /** + * Gets the value of the nVlLargura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlLargura() { + return nVlLargura; + } + + /** + * Sets the value of the nVlLargura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlLargura(BigDecimal value) { + this.nVlLargura = value; + } + + /** + * Gets the value of the nVlDiametro property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlDiametro() { + return nVlDiametro; + } + + /** + * Sets the value of the nVlDiametro property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlDiametro(BigDecimal value) { + this.nVlDiametro = value; + } + + /** + * Gets the value of the sCdMaoPropria property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdMaoPropria() { + return sCdMaoPropria; + } + + /** + * Sets the value of the sCdMaoPropria property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdMaoPropria(String value) { + this.sCdMaoPropria = value; + } + + /** + * Gets the value of the nVlValorDeclarado property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlValorDeclarado() { + return nVlValorDeclarado; + } + + /** + * Sets the value of the nVlValorDeclarado property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlValorDeclarado(BigDecimal value) { + this.nVlValorDeclarado = value; + } + + /** + * Gets the value of the sCdAvisoRecebimento property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdAvisoRecebimento() { + return sCdAvisoRecebimento; + } + + /** + * Sets the value of the sCdAvisoRecebimento property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdAvisoRecebimento(String value) { + this.sCdAvisoRecebimento = value; + } + + /** + * Gets the value of the sDtCalculo property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDtCalculo() { + return sDtCalculo; + } + + /** + * Sets the value of the sDtCalculo property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDtCalculo(String value) { + this.sDtCalculo = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoDataResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoDataResponse.class new file mode 100644 index 0000000..1e1c049 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoDataResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoDataResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoDataResponse.java new file mode 100644 index 0000000..6d3908f --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoDataResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrecoDataResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrecoDataResult" +}) +@XmlRootElement(name = "CalcPrecoDataResponse") +public class CalcPrecoDataResponse { + + @XmlElement(name = "CalcPrecoDataResult", required = true) + protected CResultado calcPrecoDataResult; + + /** + * Gets the value of the calcPrecoDataResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrecoDataResult() { + return calcPrecoDataResult; + } + + /** + * Sets the value of the calcPrecoDataResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrecoDataResult(CResultado value) { + this.calcPrecoDataResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFAC.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFAC.class new file mode 100644 index 0000000..c5e2215 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFAC.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFAC.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFAC.java new file mode 100644 index 0000000..7628433 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFAC.java @@ -0,0 +1,116 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlPeso" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="strDataCalculo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdServico", + "nVlPeso", + "strDataCalculo" +}) +@XmlRootElement(name = "CalcPrecoFAC") +public class CalcPrecoFAC { + + protected String nCdServico; + protected String nVlPeso; + protected String strDataCalculo; + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the nVlPeso property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNVlPeso() { + return nVlPeso; + } + + /** + * Sets the value of the nVlPeso property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNVlPeso(String value) { + this.nVlPeso = value; + } + + /** + * Gets the value of the strDataCalculo property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStrDataCalculo() { + return strDataCalculo; + } + + /** + * Sets the value of the strDataCalculo property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStrDataCalculo(String value) { + this.strDataCalculo = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFACResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFACResponse.class new file mode 100644 index 0000000..3a12abc Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFACResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFACResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFACResponse.java new file mode 100644 index 0000000..f647d53 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoFACResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrecoFACResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrecoFACResult" +}) +@XmlRootElement(name = "CalcPrecoFACResponse") +public class CalcPrecoFACResponse { + + @XmlElement(name = "CalcPrecoFACResult", required = true) + protected CResultado calcPrecoFACResult; + + /** + * Gets the value of the calcPrecoFACResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrecoFACResult() { + return calcPrecoFACResult; + } + + /** + * Sets the value of the calcPrecoFACResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrecoFACResult(CResultado value) { + this.calcPrecoFACResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazo.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazo.class new file mode 100644 index 0000000..770fbf9 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazo.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazo.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazo.java new file mode 100644 index 0000000..21bcc5a --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazo.java @@ -0,0 +1,412 @@ + +package br.com.correios.webservice.estimativa; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdEmpresa" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDsSenha" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlPeso" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdFormato" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="nVlComprimento" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlAltura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlLargura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlDiametro" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdMaoPropria" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlValorDeclarado" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdAvisoRecebimento" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdEmpresa", + "sDsSenha", + "nCdServico", + "sCepOrigem", + "sCepDestino", + "nVlPeso", + "nCdFormato", + "nVlComprimento", + "nVlAltura", + "nVlLargura", + "nVlDiametro", + "sCdMaoPropria", + "nVlValorDeclarado", + "sCdAvisoRecebimento" +}) +@XmlRootElement(name = "CalcPrecoPrazo") +public class CalcPrecoPrazo { + + protected String nCdEmpresa; + protected String sDsSenha; + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + protected String nVlPeso; + protected int nCdFormato; + @XmlElement(required = true) + protected BigDecimal nVlComprimento; + @XmlElement(required = true) + protected BigDecimal nVlAltura; + @XmlElement(required = true) + protected BigDecimal nVlLargura; + @XmlElement(required = true) + protected BigDecimal nVlDiametro; + protected String sCdMaoPropria; + @XmlElement(required = true) + protected BigDecimal nVlValorDeclarado; + protected String sCdAvisoRecebimento; + + /** + * Gets the value of the nCdEmpresa property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdEmpresa() { + return nCdEmpresa; + } + + /** + * Sets the value of the nCdEmpresa property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdEmpresa(String value) { + this.nCdEmpresa = value; + } + + /** + * Gets the value of the sDsSenha property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDsSenha() { + return sDsSenha; + } + + /** + * Sets the value of the sDsSenha property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDsSenha(String value) { + this.sDsSenha = value; + } + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + + /** + * Gets the value of the nVlPeso property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNVlPeso() { + return nVlPeso; + } + + /** + * Sets the value of the nVlPeso property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNVlPeso(String value) { + this.nVlPeso = value; + } + + /** + * Gets the value of the nCdFormato property. + * + */ + public int getNCdFormato() { + return nCdFormato; + } + + /** + * Sets the value of the nCdFormato property. + * + */ + public void setNCdFormato(int value) { + this.nCdFormato = value; + } + + /** + * Gets the value of the nVlComprimento property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlComprimento() { + return nVlComprimento; + } + + /** + * Sets the value of the nVlComprimento property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlComprimento(BigDecimal value) { + this.nVlComprimento = value; + } + + /** + * Gets the value of the nVlAltura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlAltura() { + return nVlAltura; + } + + /** + * Sets the value of the nVlAltura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlAltura(BigDecimal value) { + this.nVlAltura = value; + } + + /** + * Gets the value of the nVlLargura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlLargura() { + return nVlLargura; + } + + /** + * Sets the value of the nVlLargura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlLargura(BigDecimal value) { + this.nVlLargura = value; + } + + /** + * Gets the value of the nVlDiametro property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlDiametro() { + return nVlDiametro; + } + + /** + * Sets the value of the nVlDiametro property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlDiametro(BigDecimal value) { + this.nVlDiametro = value; + } + + /** + * Gets the value of the sCdMaoPropria property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdMaoPropria() { + return sCdMaoPropria; + } + + /** + * Sets the value of the sCdMaoPropria property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdMaoPropria(String value) { + this.sCdMaoPropria = value; + } + + /** + * Gets the value of the nVlValorDeclarado property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlValorDeclarado() { + return nVlValorDeclarado; + } + + /** + * Sets the value of the nVlValorDeclarado property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlValorDeclarado(BigDecimal value) { + this.nVlValorDeclarado = value; + } + + /** + * Gets the value of the sCdAvisoRecebimento property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdAvisoRecebimento() { + return sCdAvisoRecebimento; + } + + /** + * Sets the value of the sCdAvisoRecebimento property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdAvisoRecebimento(String value) { + this.sCdAvisoRecebimento = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoData.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoData.class new file mode 100644 index 0000000..8f3b216 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoData.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoData.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoData.java new file mode 100644 index 0000000..c25ac70 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoData.java @@ -0,0 +1,439 @@ + +package br.com.correios.webservice.estimativa; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdEmpresa" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDsSenha" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlPeso" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdFormato" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="nVlComprimento" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlAltura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlLargura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlDiametro" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdMaoPropria" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlValorDeclarado" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdAvisoRecebimento" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDtCalculo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdEmpresa", + "sDsSenha", + "nCdServico", + "sCepOrigem", + "sCepDestino", + "nVlPeso", + "nCdFormato", + "nVlComprimento", + "nVlAltura", + "nVlLargura", + "nVlDiametro", + "sCdMaoPropria", + "nVlValorDeclarado", + "sCdAvisoRecebimento", + "sDtCalculo" +}) +@XmlRootElement(name = "CalcPrecoPrazoData") +public class CalcPrecoPrazoData { + + protected String nCdEmpresa; + protected String sDsSenha; + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + protected String nVlPeso; + protected int nCdFormato; + @XmlElement(required = true) + protected BigDecimal nVlComprimento; + @XmlElement(required = true) + protected BigDecimal nVlAltura; + @XmlElement(required = true) + protected BigDecimal nVlLargura; + @XmlElement(required = true) + protected BigDecimal nVlDiametro; + protected String sCdMaoPropria; + @XmlElement(required = true) + protected BigDecimal nVlValorDeclarado; + protected String sCdAvisoRecebimento; + protected String sDtCalculo; + + /** + * Gets the value of the nCdEmpresa property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdEmpresa() { + return nCdEmpresa; + } + + /** + * Sets the value of the nCdEmpresa property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdEmpresa(String value) { + this.nCdEmpresa = value; + } + + /** + * Gets the value of the sDsSenha property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDsSenha() { + return sDsSenha; + } + + /** + * Sets the value of the sDsSenha property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDsSenha(String value) { + this.sDsSenha = value; + } + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + + /** + * Gets the value of the nVlPeso property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNVlPeso() { + return nVlPeso; + } + + /** + * Sets the value of the nVlPeso property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNVlPeso(String value) { + this.nVlPeso = value; + } + + /** + * Gets the value of the nCdFormato property. + * + */ + public int getNCdFormato() { + return nCdFormato; + } + + /** + * Sets the value of the nCdFormato property. + * + */ + public void setNCdFormato(int value) { + this.nCdFormato = value; + } + + /** + * Gets the value of the nVlComprimento property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlComprimento() { + return nVlComprimento; + } + + /** + * Sets the value of the nVlComprimento property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlComprimento(BigDecimal value) { + this.nVlComprimento = value; + } + + /** + * Gets the value of the nVlAltura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlAltura() { + return nVlAltura; + } + + /** + * Sets the value of the nVlAltura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlAltura(BigDecimal value) { + this.nVlAltura = value; + } + + /** + * Gets the value of the nVlLargura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlLargura() { + return nVlLargura; + } + + /** + * Sets the value of the nVlLargura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlLargura(BigDecimal value) { + this.nVlLargura = value; + } + + /** + * Gets the value of the nVlDiametro property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlDiametro() { + return nVlDiametro; + } + + /** + * Sets the value of the nVlDiametro property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlDiametro(BigDecimal value) { + this.nVlDiametro = value; + } + + /** + * Gets the value of the sCdMaoPropria property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdMaoPropria() { + return sCdMaoPropria; + } + + /** + * Sets the value of the sCdMaoPropria property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdMaoPropria(String value) { + this.sCdMaoPropria = value; + } + + /** + * Gets the value of the nVlValorDeclarado property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlValorDeclarado() { + return nVlValorDeclarado; + } + + /** + * Sets the value of the nVlValorDeclarado property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlValorDeclarado(BigDecimal value) { + this.nVlValorDeclarado = value; + } + + /** + * Gets the value of the sCdAvisoRecebimento property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdAvisoRecebimento() { + return sCdAvisoRecebimento; + } + + /** + * Sets the value of the sCdAvisoRecebimento property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdAvisoRecebimento(String value) { + this.sCdAvisoRecebimento = value; + } + + /** + * Gets the value of the sDtCalculo property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDtCalculo() { + return sDtCalculo; + } + + /** + * Sets the value of the sDtCalculo property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDtCalculo(String value) { + this.sDtCalculo = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoDataResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoDataResponse.class new file mode 100644 index 0000000..dbb2d24 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoDataResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoDataResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoDataResponse.java new file mode 100644 index 0000000..b1d6dce --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoDataResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrecoPrazoDataResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrecoPrazoDataResult" +}) +@XmlRootElement(name = "CalcPrecoPrazoDataResponse") +public class CalcPrecoPrazoDataResponse { + + @XmlElement(name = "CalcPrecoPrazoDataResult", required = true) + protected CResultado calcPrecoPrazoDataResult; + + /** + * Gets the value of the calcPrecoPrazoDataResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrecoPrazoDataResult() { + return calcPrecoPrazoDataResult; + } + + /** + * Sets the value of the calcPrecoPrazoDataResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrecoPrazoDataResult(CResultado value) { + this.calcPrecoPrazoDataResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoResponse.class new file mode 100644 index 0000000..1e024f7 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoResponse.java new file mode 100644 index 0000000..c298ab5 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrecoPrazoResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrecoPrazoResult" +}) +@XmlRootElement(name = "CalcPrecoPrazoResponse") +public class CalcPrecoPrazoResponse { + + @XmlElement(name = "CalcPrecoPrazoResult", required = true) + protected CResultado calcPrecoPrazoResult; + + /** + * Gets the value of the calcPrecoPrazoResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrecoPrazoResult() { + return calcPrecoPrazoResult; + } + + /** + * Sets the value of the calcPrecoPrazoResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrecoPrazoResult(CResultado value) { + this.calcPrecoPrazoResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricao.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricao.class new file mode 100644 index 0000000..a8c7fa1 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricao.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricao.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricao.java new file mode 100644 index 0000000..d15c2f9 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricao.java @@ -0,0 +1,439 @@ + +package br.com.correios.webservice.estimativa; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="nCdEmpresa" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDsSenha" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdServico" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepOrigem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sCepDestino" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlPeso" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nCdFormato" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="nVlComprimento" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlAltura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlLargura" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="nVlDiametro" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdMaoPropria" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="nVlValorDeclarado" type="{http://www.w3.org/2001/XMLSchema}decimal"/>
+ *         <element name="sCdAvisoRecebimento" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sDtCalculo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "nCdEmpresa", + "sDsSenha", + "nCdServico", + "sCepOrigem", + "sCepDestino", + "nVlPeso", + "nCdFormato", + "nVlComprimento", + "nVlAltura", + "nVlLargura", + "nVlDiametro", + "sCdMaoPropria", + "nVlValorDeclarado", + "sCdAvisoRecebimento", + "sDtCalculo" +}) +@XmlRootElement(name = "CalcPrecoPrazoRestricao") +public class CalcPrecoPrazoRestricao { + + protected String nCdEmpresa; + protected String sDsSenha; + protected String nCdServico; + protected String sCepOrigem; + protected String sCepDestino; + protected String nVlPeso; + protected int nCdFormato; + @XmlElement(required = true) + protected BigDecimal nVlComprimento; + @XmlElement(required = true) + protected BigDecimal nVlAltura; + @XmlElement(required = true) + protected BigDecimal nVlLargura; + @XmlElement(required = true) + protected BigDecimal nVlDiametro; + protected String sCdMaoPropria; + @XmlElement(required = true) + protected BigDecimal nVlValorDeclarado; + protected String sCdAvisoRecebimento; + protected String sDtCalculo; + + /** + * Gets the value of the nCdEmpresa property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdEmpresa() { + return nCdEmpresa; + } + + /** + * Sets the value of the nCdEmpresa property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdEmpresa(String value) { + this.nCdEmpresa = value; + } + + /** + * Gets the value of the sDsSenha property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDsSenha() { + return sDsSenha; + } + + /** + * Sets the value of the sDsSenha property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDsSenha(String value) { + this.sDsSenha = value; + } + + /** + * Gets the value of the nCdServico property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNCdServico() { + return nCdServico; + } + + /** + * Sets the value of the nCdServico property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNCdServico(String value) { + this.nCdServico = value; + } + + /** + * Gets the value of the sCepOrigem property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepOrigem() { + return sCepOrigem; + } + + /** + * Sets the value of the sCepOrigem property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepOrigem(String value) { + this.sCepOrigem = value; + } + + /** + * Gets the value of the sCepDestino property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCepDestino() { + return sCepDestino; + } + + /** + * Sets the value of the sCepDestino property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCepDestino(String value) { + this.sCepDestino = value; + } + + /** + * Gets the value of the nVlPeso property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNVlPeso() { + return nVlPeso; + } + + /** + * Sets the value of the nVlPeso property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNVlPeso(String value) { + this.nVlPeso = value; + } + + /** + * Gets the value of the nCdFormato property. + * + */ + public int getNCdFormato() { + return nCdFormato; + } + + /** + * Sets the value of the nCdFormato property. + * + */ + public void setNCdFormato(int value) { + this.nCdFormato = value; + } + + /** + * Gets the value of the nVlComprimento property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlComprimento() { + return nVlComprimento; + } + + /** + * Sets the value of the nVlComprimento property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlComprimento(BigDecimal value) { + this.nVlComprimento = value; + } + + /** + * Gets the value of the nVlAltura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlAltura() { + return nVlAltura; + } + + /** + * Sets the value of the nVlAltura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlAltura(BigDecimal value) { + this.nVlAltura = value; + } + + /** + * Gets the value of the nVlLargura property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlLargura() { + return nVlLargura; + } + + /** + * Sets the value of the nVlLargura property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlLargura(BigDecimal value) { + this.nVlLargura = value; + } + + /** + * Gets the value of the nVlDiametro property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlDiametro() { + return nVlDiametro; + } + + /** + * Sets the value of the nVlDiametro property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlDiametro(BigDecimal value) { + this.nVlDiametro = value; + } + + /** + * Gets the value of the sCdMaoPropria property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdMaoPropria() { + return sCdMaoPropria; + } + + /** + * Sets the value of the sCdMaoPropria property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdMaoPropria(String value) { + this.sCdMaoPropria = value; + } + + /** + * Gets the value of the nVlValorDeclarado property. + * + * @return + * possible object is + * {@link BigDecimal } + * + */ + public BigDecimal getNVlValorDeclarado() { + return nVlValorDeclarado; + } + + /** + * Sets the value of the nVlValorDeclarado property. + * + * @param value + * allowed object is + * {@link BigDecimal } + * + */ + public void setNVlValorDeclarado(BigDecimal value) { + this.nVlValorDeclarado = value; + } + + /** + * Gets the value of the sCdAvisoRecebimento property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSCdAvisoRecebimento() { + return sCdAvisoRecebimento; + } + + /** + * Sets the value of the sCdAvisoRecebimento property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSCdAvisoRecebimento(String value) { + this.sCdAvisoRecebimento = value; + } + + /** + * Gets the value of the sDtCalculo property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSDtCalculo() { + return sDtCalculo; + } + + /** + * Sets the value of the sDtCalculo property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSDtCalculo(String value) { + this.sDtCalculo = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricaoResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricaoResponse.class new file mode 100644 index 0000000..e0537fe Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricaoResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricaoResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricaoResponse.java new file mode 100644 index 0000000..0534e91 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoRestricaoResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrecoPrazoRestricaoResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrecoPrazoRestricaoResult" +}) +@XmlRootElement(name = "CalcPrecoPrazoRestricaoResponse") +public class CalcPrecoPrazoRestricaoResponse { + + @XmlElement(name = "CalcPrecoPrazoRestricaoResult", required = true) + protected CResultado calcPrecoPrazoRestricaoResult; + + /** + * Gets the value of the calcPrecoPrazoRestricaoResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrecoPrazoRestricaoResult() { + return calcPrecoPrazoRestricaoResult; + } + + /** + * Sets the value of the calcPrecoPrazoRestricaoResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrecoPrazoRestricaoResult(CResultado value) { + this.calcPrecoPrazoRestricaoResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWS.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWS.class new file mode 100644 index 0000000..14f2106 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWS.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWS.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWS.java new file mode 100644 index 0000000..2290a88 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWS.java @@ -0,0 +1,94 @@ + +package br.com.correios.webservice.estimativa; + +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.9-b130926.1035 + * Generated source version: 2.2 + * + */ +@WebServiceClient(name = "CalcPrecoPrazoWS", targetNamespace = "http://tempuri.org/", wsdlLocation = "http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx?wsdl") +public class CalcPrecoPrazoWS + extends Service +{ + + private final static URL CALCPRECOPRAZOWS_WSDL_LOCATION; + private final static WebServiceException CALCPRECOPRAZOWS_EXCEPTION; + private final static QName CALCPRECOPRAZOWS_QNAME = new QName("http://tempuri.org/", "CalcPrecoPrazoWS"); + + static { + URL url = null; + WebServiceException e = null; + try { + url = new URL("http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx?wsdl"); + } catch (MalformedURLException ex) { + e = new WebServiceException(ex); + } + CALCPRECOPRAZOWS_WSDL_LOCATION = url; + CALCPRECOPRAZOWS_EXCEPTION = e; + } + + public CalcPrecoPrazoWS() { + super(__getWsdlLocation(), CALCPRECOPRAZOWS_QNAME); + } + + public CalcPrecoPrazoWS(WebServiceFeature... features) { + super(__getWsdlLocation(), CALCPRECOPRAZOWS_QNAME, features); + } + + public CalcPrecoPrazoWS(URL wsdlLocation) { + super(wsdlLocation, CALCPRECOPRAZOWS_QNAME); + } + + public CalcPrecoPrazoWS(URL wsdlLocation, WebServiceFeature... features) { + super(wsdlLocation, CALCPRECOPRAZOWS_QNAME, features); + } + + public CalcPrecoPrazoWS(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public CalcPrecoPrazoWS(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { + super(wsdlLocation, serviceName, features); + } + + /** + * + * @return + * returns CalcPrecoPrazoWSSoap + */ + @WebEndpoint(name = "CalcPrecoPrazoWSSoap") + public CalcPrecoPrazoWSSoap getCalcPrecoPrazoWSSoap() { + return super.getPort(new QName("http://tempuri.org/", "CalcPrecoPrazoWSSoap"), CalcPrecoPrazoWSSoap.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns CalcPrecoPrazoWSSoap + */ + @WebEndpoint(name = "CalcPrecoPrazoWSSoap") + public CalcPrecoPrazoWSSoap getCalcPrecoPrazoWSSoap(WebServiceFeature... features) { + return super.getPort(new QName("http://tempuri.org/", "CalcPrecoPrazoWSSoap"), CalcPrecoPrazoWSSoap.class, features); + } + + private static URL __getWsdlLocation() { + if (CALCPRECOPRAZOWS_EXCEPTION!= null) { + throw CALCPRECOPRAZOWS_EXCEPTION; + } + return CALCPRECOPRAZOWS_WSDL_LOCATION; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWSSoap.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWSSoap.class new file mode 100644 index 0000000..3784a22 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWSSoap.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWSSoap.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWSSoap.java new file mode 100644 index 0000000..e5b95e9 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoPrazoWSSoap.java @@ -0,0 +1,387 @@ + +package br.com.correios.webservice.estimativa; + +import java.math.BigDecimal; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.9-b130926.1035 + * Generated source version: 2.2 + * + */ +@WebService(name = "CalcPrecoPrazoWSSoap", targetNamespace = "http://tempuri.org/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface CalcPrecoPrazoWSSoap { + + + /** + * + * @param nCdEmpresa + * @param nVlDiametro + * @param sCdMaoPropria + * @param sCepDestino + * @param nCdFormato + * @param nVlPeso + * @param nVlLargura + * @param nVlComprimento + * @param sCdAvisoRecebimento + * @param nCdServico + * @param sCepOrigem + * @param nVlValorDeclarado + * @param sDsSenha + * @param nVlAltura + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrecoPrazo", action = "http://tempuri.org/CalcPrecoPrazo") + @WebResult(name = "CalcPrecoPrazoResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrecoPrazo", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoPrazo") + @ResponseWrapper(localName = "CalcPrecoPrazoResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoPrazoResponse") + public CResultado calcPrecoPrazo( + @WebParam(name = "nCdEmpresa", targetNamespace = "http://tempuri.org/") + String nCdEmpresa, + @WebParam(name = "sDsSenha", targetNamespace = "http://tempuri.org/") + String sDsSenha, + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino, + @WebParam(name = "nVlPeso", targetNamespace = "http://tempuri.org/") + String nVlPeso, + @WebParam(name = "nCdFormato", targetNamespace = "http://tempuri.org/") + int nCdFormato, + @WebParam(name = "nVlComprimento", targetNamespace = "http://tempuri.org/") + BigDecimal nVlComprimento, + @WebParam(name = "nVlAltura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlAltura, + @WebParam(name = "nVlLargura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlLargura, + @WebParam(name = "nVlDiametro", targetNamespace = "http://tempuri.org/") + BigDecimal nVlDiametro, + @WebParam(name = "sCdMaoPropria", targetNamespace = "http://tempuri.org/") + String sCdMaoPropria, + @WebParam(name = "nVlValorDeclarado", targetNamespace = "http://tempuri.org/") + BigDecimal nVlValorDeclarado, + @WebParam(name = "sCdAvisoRecebimento", targetNamespace = "http://tempuri.org/") + String sCdAvisoRecebimento); + + /** + * + * @param nCdEmpresa + * @param nVlDiametro + * @param sCdMaoPropria + * @param sCepDestino + * @param nCdFormato + * @param nVlPeso + * @param nVlLargura + * @param nVlComprimento + * @param sCdAvisoRecebimento + * @param nCdServico + * @param sCepOrigem + * @param nVlValorDeclarado + * @param sDtCalculo + * @param sDsSenha + * @param nVlAltura + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrecoPrazoData", action = "http://tempuri.org/CalcPrecoPrazoData") + @WebResult(name = "CalcPrecoPrazoDataResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrecoPrazoData", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoPrazoData") + @ResponseWrapper(localName = "CalcPrecoPrazoDataResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoPrazoDataResponse") + public CResultado calcPrecoPrazoData( + @WebParam(name = "nCdEmpresa", targetNamespace = "http://tempuri.org/") + String nCdEmpresa, + @WebParam(name = "sDsSenha", targetNamespace = "http://tempuri.org/") + String sDsSenha, + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino, + @WebParam(name = "nVlPeso", targetNamespace = "http://tempuri.org/") + String nVlPeso, + @WebParam(name = "nCdFormato", targetNamespace = "http://tempuri.org/") + int nCdFormato, + @WebParam(name = "nVlComprimento", targetNamespace = "http://tempuri.org/") + BigDecimal nVlComprimento, + @WebParam(name = "nVlAltura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlAltura, + @WebParam(name = "nVlLargura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlLargura, + @WebParam(name = "nVlDiametro", targetNamespace = "http://tempuri.org/") + BigDecimal nVlDiametro, + @WebParam(name = "sCdMaoPropria", targetNamespace = "http://tempuri.org/") + String sCdMaoPropria, + @WebParam(name = "nVlValorDeclarado", targetNamespace = "http://tempuri.org/") + BigDecimal nVlValorDeclarado, + @WebParam(name = "sCdAvisoRecebimento", targetNamespace = "http://tempuri.org/") + String sCdAvisoRecebimento, + @WebParam(name = "sDtCalculo", targetNamespace = "http://tempuri.org/") + String sDtCalculo); + + /** + * + * @param nCdEmpresa + * @param nVlDiametro + * @param sCdMaoPropria + * @param sCepDestino + * @param nCdFormato + * @param nVlPeso + * @param nVlLargura + * @param nVlComprimento + * @param sCdAvisoRecebimento + * @param nCdServico + * @param sCepOrigem + * @param nVlValorDeclarado + * @param sDtCalculo + * @param sDsSenha + * @param nVlAltura + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrecoPrazoRestricao", action = "http://tempuri.org/CalcPrecoPrazoRestricao") + @WebResult(name = "CalcPrecoPrazoRestricaoResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrecoPrazoRestricao", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoPrazoRestricao") + @ResponseWrapper(localName = "CalcPrecoPrazoRestricaoResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoPrazoRestricaoResponse") + public CResultado calcPrecoPrazoRestricao( + @WebParam(name = "nCdEmpresa", targetNamespace = "http://tempuri.org/") + String nCdEmpresa, + @WebParam(name = "sDsSenha", targetNamespace = "http://tempuri.org/") + String sDsSenha, + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino, + @WebParam(name = "nVlPeso", targetNamespace = "http://tempuri.org/") + String nVlPeso, + @WebParam(name = "nCdFormato", targetNamespace = "http://tempuri.org/") + int nCdFormato, + @WebParam(name = "nVlComprimento", targetNamespace = "http://tempuri.org/") + BigDecimal nVlComprimento, + @WebParam(name = "nVlAltura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlAltura, + @WebParam(name = "nVlLargura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlLargura, + @WebParam(name = "nVlDiametro", targetNamespace = "http://tempuri.org/") + BigDecimal nVlDiametro, + @WebParam(name = "sCdMaoPropria", targetNamespace = "http://tempuri.org/") + String sCdMaoPropria, + @WebParam(name = "nVlValorDeclarado", targetNamespace = "http://tempuri.org/") + BigDecimal nVlValorDeclarado, + @WebParam(name = "sCdAvisoRecebimento", targetNamespace = "http://tempuri.org/") + String sCdAvisoRecebimento, + @WebParam(name = "sDtCalculo", targetNamespace = "http://tempuri.org/") + String sDtCalculo); + + /** + * + * @param nCdEmpresa + * @param nVlDiametro + * @param sCdMaoPropria + * @param sCepDestino + * @param nCdFormato + * @param nVlPeso + * @param nVlLargura + * @param nVlComprimento + * @param sCdAvisoRecebimento + * @param nCdServico + * @param sCepOrigem + * @param nVlValorDeclarado + * @param sDsSenha + * @param nVlAltura + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPreco", action = "http://tempuri.org/CalcPreco") + @WebResult(name = "CalcPrecoResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPreco", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPreco") + @ResponseWrapper(localName = "CalcPrecoResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoResponse") + public CResultado calcPreco( + @WebParam(name = "nCdEmpresa", targetNamespace = "http://tempuri.org/") + String nCdEmpresa, + @WebParam(name = "sDsSenha", targetNamespace = "http://tempuri.org/") + String sDsSenha, + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino, + @WebParam(name = "nVlPeso", targetNamespace = "http://tempuri.org/") + String nVlPeso, + @WebParam(name = "nCdFormato", targetNamespace = "http://tempuri.org/") + int nCdFormato, + @WebParam(name = "nVlComprimento", targetNamespace = "http://tempuri.org/") + BigDecimal nVlComprimento, + @WebParam(name = "nVlAltura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlAltura, + @WebParam(name = "nVlLargura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlLargura, + @WebParam(name = "nVlDiametro", targetNamespace = "http://tempuri.org/") + BigDecimal nVlDiametro, + @WebParam(name = "sCdMaoPropria", targetNamespace = "http://tempuri.org/") + String sCdMaoPropria, + @WebParam(name = "nVlValorDeclarado", targetNamespace = "http://tempuri.org/") + BigDecimal nVlValorDeclarado, + @WebParam(name = "sCdAvisoRecebimento", targetNamespace = "http://tempuri.org/") + String sCdAvisoRecebimento); + + /** + * + * @param nCdEmpresa + * @param nVlDiametro + * @param sCdMaoPropria + * @param sCepDestino + * @param nCdFormato + * @param nVlPeso + * @param nVlLargura + * @param nVlComprimento + * @param sCdAvisoRecebimento + * @param nCdServico + * @param sCepOrigem + * @param nVlValorDeclarado + * @param sDtCalculo + * @param sDsSenha + * @param nVlAltura + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrecoData", action = "http://tempuri.org/CalcPrecoData") + @WebResult(name = "CalcPrecoDataResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrecoData", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoData") + @ResponseWrapper(localName = "CalcPrecoDataResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoDataResponse") + public CResultado calcPrecoData( + @WebParam(name = "nCdEmpresa", targetNamespace = "http://tempuri.org/") + String nCdEmpresa, + @WebParam(name = "sDsSenha", targetNamespace = "http://tempuri.org/") + String sDsSenha, + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino, + @WebParam(name = "nVlPeso", targetNamespace = "http://tempuri.org/") + String nVlPeso, + @WebParam(name = "nCdFormato", targetNamespace = "http://tempuri.org/") + int nCdFormato, + @WebParam(name = "nVlComprimento", targetNamespace = "http://tempuri.org/") + BigDecimal nVlComprimento, + @WebParam(name = "nVlAltura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlAltura, + @WebParam(name = "nVlLargura", targetNamespace = "http://tempuri.org/") + BigDecimal nVlLargura, + @WebParam(name = "nVlDiametro", targetNamespace = "http://tempuri.org/") + BigDecimal nVlDiametro, + @WebParam(name = "sCdMaoPropria", targetNamespace = "http://tempuri.org/") + String sCdMaoPropria, + @WebParam(name = "nVlValorDeclarado", targetNamespace = "http://tempuri.org/") + BigDecimal nVlValorDeclarado, + @WebParam(name = "sCdAvisoRecebimento", targetNamespace = "http://tempuri.org/") + String sCdAvisoRecebimento, + @WebParam(name = "sDtCalculo", targetNamespace = "http://tempuri.org/") + String sDtCalculo); + + /** + * + * @param nCdServico + * @param sCepDestino + * @param sCepOrigem + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrazo", action = "http://tempuri.org/CalcPrazo") + @WebResult(name = "CalcPrazoResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrazo", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrazo") + @ResponseWrapper(localName = "CalcPrazoResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrazoResponse") + public CResultado calcPrazo( + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino); + + /** + * + * @param nCdServico + * @param sCepDestino + * @param sCepOrigem + * @param sDtCalculo + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrazoData", action = "http://tempuri.org/CalcPrazoData") + @WebResult(name = "CalcPrazoDataResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrazoData", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrazoData") + @ResponseWrapper(localName = "CalcPrazoDataResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrazoDataResponse") + public CResultado calcPrazoData( + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino, + @WebParam(name = "sDtCalculo", targetNamespace = "http://tempuri.org/") + String sDtCalculo); + + /** + * + * @param nCdServico + * @param sCepDestino + * @param sCepOrigem + * @param sDtCalculo + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrazoRestricao", action = "http://tempuri.org/CalcPrazoRestricao") + @WebResult(name = "CalcPrazoRestricaoResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrazoRestricao", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrazoRestricao") + @ResponseWrapper(localName = "CalcPrazoRestricaoResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrazoRestricaoResponse") + public CResultado calcPrazoRestricao( + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "sCepOrigem", targetNamespace = "http://tempuri.org/") + String sCepOrigem, + @WebParam(name = "sCepDestino", targetNamespace = "http://tempuri.org/") + String sCepDestino, + @WebParam(name = "sDtCalculo", targetNamespace = "http://tempuri.org/") + String sDtCalculo); + + /** + * + * @param nVlPeso + * @param strDataCalculo + * @param nCdServico + * @return + * returns br.com.correios.webservice.estimativa.CResultado + */ + @WebMethod(operationName = "CalcPrecoFAC", action = "http://tempuri.org/CalcPrecoFAC") + @WebResult(name = "CalcPrecoFACResult", targetNamespace = "http://tempuri.org/") + @RequestWrapper(localName = "CalcPrecoFAC", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoFAC") + @ResponseWrapper(localName = "CalcPrecoFACResponse", targetNamespace = "http://tempuri.org/", className = "br.com.correios.webservice.estimativa.CalcPrecoFACResponse") + public CResultado calcPrecoFAC( + @WebParam(name = "nCdServico", targetNamespace = "http://tempuri.org/") + String nCdServico, + @WebParam(name = "nVlPeso", targetNamespace = "http://tempuri.org/") + String nVlPeso, + @WebParam(name = "strDataCalculo", targetNamespace = "http://tempuri.org/") + String strDataCalculo); + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoResponse.class b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoResponse.class new file mode 100644 index 0000000..22c6bdc Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoResponse.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoResponse.java b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoResponse.java new file mode 100644 index 0000000..d8570c4 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/CalcPrecoResponse.java @@ -0,0 +1,64 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CalcPrecoResult" type="{http://tempuri.org/}cResultado"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "calcPrecoResult" +}) +@XmlRootElement(name = "CalcPrecoResponse") +public class CalcPrecoResponse { + + @XmlElement(name = "CalcPrecoResult", required = true) + protected CResultado calcPrecoResult; + + /** + * Gets the value of the calcPrecoResult property. + * + * @return + * possible object is + * {@link CResultado } + * + */ + public CResultado getCalcPrecoResult() { + return calcPrecoResult; + } + + /** + * Sets the value of the calcPrecoResult property. + * + * @param value + * allowed object is + * {@link CResultado } + * + */ + public void setCalcPrecoResult(CResultado value) { + this.calcPrecoResult = value; + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/ObjectFactory.class b/src/main/java/br/com/correios/webservice/estimativa/ObjectFactory.class new file mode 100644 index 0000000..740d0cf Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/ObjectFactory.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/ObjectFactory.java b/src/main/java/br/com/correios/webservice/estimativa/ObjectFactory.java new file mode 100644 index 0000000..ad0e252 --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/ObjectFactory.java @@ -0,0 +1,213 @@ + +package br.com.correios.webservice.estimativa; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the br.com.correios.webservice.estimativa package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _CResultado_QNAME = new QName("http://tempuri.org/", "cResultado"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: br.com.correios.webservice.estimativa + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link CalcPrecoData } + * + */ + public CalcPrecoData createCalcPrecoData() { + return new CalcPrecoData(); + } + + /** + * Create an instance of {@link CalcPrazoResponse } + * + */ + public CalcPrazoResponse createCalcPrazoResponse() { + return new CalcPrazoResponse(); + } + + /** + * Create an instance of {@link CResultado } + * + */ + public CResultado createCResultado() { + return new CResultado(); + } + + /** + * Create an instance of {@link CalcPrecoPrazoData } + * + */ + public CalcPrecoPrazoData createCalcPrecoPrazoData() { + return new CalcPrecoPrazoData(); + } + + /** + * Create an instance of {@link CalcPrecoPrazoRestricao } + * + */ + public CalcPrecoPrazoRestricao createCalcPrecoPrazoRestricao() { + return new CalcPrecoPrazoRestricao(); + } + + /** + * Create an instance of {@link CalcPrecoFACResponse } + * + */ + public CalcPrecoFACResponse createCalcPrecoFACResponse() { + return new CalcPrecoFACResponse(); + } + + /** + * Create an instance of {@link CalcPrazoData } + * + */ + public CalcPrazoData createCalcPrazoData() { + return new CalcPrazoData(); + } + + /** + * Create an instance of {@link CalcPrecoPrazoResponse } + * + */ + public CalcPrecoPrazoResponse createCalcPrecoPrazoResponse() { + return new CalcPrecoPrazoResponse(); + } + + /** + * Create an instance of {@link CalcPrecoResponse } + * + */ + public CalcPrecoResponse createCalcPrecoResponse() { + return new CalcPrecoResponse(); + } + + /** + * Create an instance of {@link CalcPrecoDataResponse } + * + */ + public CalcPrecoDataResponse createCalcPrecoDataResponse() { + return new CalcPrecoDataResponse(); + } + + /** + * Create an instance of {@link CalcPreco } + * + */ + public CalcPreco createCalcPreco() { + return new CalcPreco(); + } + + /** + * Create an instance of {@link CalcPrazoRestricao } + * + */ + public CalcPrazoRestricao createCalcPrazoRestricao() { + return new CalcPrazoRestricao(); + } + + /** + * Create an instance of {@link CalcPrecoFAC } + * + */ + public CalcPrecoFAC createCalcPrecoFAC() { + return new CalcPrecoFAC(); + } + + /** + * Create an instance of {@link CalcPrazo } + * + */ + public CalcPrazo createCalcPrazo() { + return new CalcPrazo(); + } + + /** + * Create an instance of {@link CalcPrecoPrazoRestricaoResponse } + * + */ + public CalcPrecoPrazoRestricaoResponse createCalcPrecoPrazoRestricaoResponse() { + return new CalcPrecoPrazoRestricaoResponse(); + } + + /** + * Create an instance of {@link CalcPrazoRestricaoResponse } + * + */ + public CalcPrazoRestricaoResponse createCalcPrazoRestricaoResponse() { + return new CalcPrazoRestricaoResponse(); + } + + /** + * Create an instance of {@link CalcPrazoDataResponse } + * + */ + public CalcPrazoDataResponse createCalcPrazoDataResponse() { + return new CalcPrazoDataResponse(); + } + + /** + * Create an instance of {@link CalcPrecoPrazo } + * + */ + public CalcPrecoPrazo createCalcPrecoPrazo() { + return new CalcPrecoPrazo(); + } + + /** + * Create an instance of {@link CalcPrecoPrazoDataResponse } + * + */ + public CalcPrecoPrazoDataResponse createCalcPrecoPrazoDataResponse() { + return new CalcPrecoPrazoDataResponse(); + } + + /** + * Create an instance of {@link ArrayOfCServico } + * + */ + public ArrayOfCServico createArrayOfCServico() { + return new ArrayOfCServico(); + } + + /** + * Create an instance of {@link CServico } + * + */ + public CServico createCServico() { + return new CServico(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CResultado }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://tempuri.org/", name = "cResultado") + public JAXBElement createCResultado(CResultado value) { + return new JAXBElement(_CResultado_QNAME, CResultado.class, null, value); + } + +} diff --git a/src/main/java/br/com/correios/webservice/estimativa/package-info.class b/src/main/java/br/com/correios/webservice/estimativa/package-info.class new file mode 100644 index 0000000..10d5498 Binary files /dev/null and b/src/main/java/br/com/correios/webservice/estimativa/package-info.class differ diff --git a/src/main/java/br/com/correios/webservice/estimativa/package-info.java b/src/main/java/br/com/correios/webservice/estimativa/package-info.java new file mode 100644 index 0000000..92690ec --- /dev/null +++ b/src/main/java/br/com/correios/webservice/estimativa/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://tempuri.org/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package br.com.correios.webservice.estimativa; diff --git a/src/test/java/br/com/correios/CepTest.java b/src/test/java/br/com/correios/CepTest.java new file mode 100644 index 0000000..7e1f2d2 --- /dev/null +++ b/src/test/java/br/com/correios/CepTest.java @@ -0,0 +1,24 @@ +package br.com.correios; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class CepTest { + + @Test + public void deveriaConseguirCriarUmCepEPegarSeuValor() { + assertEquals("00123789", new Cep("00123789").value()); + } + + @Test(expected=IllegalArgumentException.class) + public void deveriaLancarExcecaoQuandoHouverMenosNumeros() { + new Cep("123456"); + } + + @Test(expected=IllegalArgumentException.class) + public void deveriaLancarExcecaoQuandoHouverLetras() { + new Cep("abcde123"); + } + +} diff --git a/src/test/java/br/com/correios/api/estimativa/CorreiosEstimativaAPITest.java b/src/test/java/br/com/correios/api/estimativa/CorreiosEstimativaAPITest.java new file mode 100644 index 0000000..8424c5b --- /dev/null +++ b/src/test/java/br/com/correios/api/estimativa/CorreiosEstimativaAPITest.java @@ -0,0 +1,112 @@ +package br.com.correios.api.estimativa; + +import static br.com.correios.api.postagem.dimensao.DimensoesDoObjeto.TipoDoObjetoSendoEnviado.PACOTE_OU_CAIXA; +import static java.math.BigDecimal.TEN; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.math.BigDecimal; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; + +import br.com.correios.Cep; +import br.com.correios.credentials.CorreiosCredenciais; +import br.com.correios.estimativa.DimensoesPacoteEstimado; +import br.com.correios.estimativa.EstimativaComPrazo; +import br.com.correios.estimativa.EstimativaComPrecoEPrazo; + +public class CorreiosEstimativaAPITest { + + private DimensoesPacoteEstimado dimensoesPacoteEstimado; + private CorreiosEstimativaAPI correiosEstimativaAPI; + + @Before + public void setup() { + CorreiosCredenciais correiosCredenciais = new CorreiosCredenciais("usuario", "senha"); + correiosEstimativaAPI = new CorreiosEstimativaAPI(correiosCredenciais); + + dimensoesPacoteEstimado = DimensoesPacoteEstimado.builder() + .comTipoDeObjeto(PACOTE_OU_CAIXA) + .comPeso(BigDecimal.ONE) + .comComprimento(BigDecimal.valueOf(16)) + .comAltura(TEN) + .comLargura(BigDecimal.valueOf(11)) + .montaDimensoes(); + } + + @Test + public void deveriaCalcularPrecoEPrazo() { + List estimativa = correiosEstimativaAPI.estimaPrecoEPrazo() + .de(new Cep("11015231")) + .para(new Cep("11045530")) + .comServicos("04510") + .comDimensoesDePacote(dimensoesPacoteEstimado) + .comValorDeclarado(BigDecimal.valueOf(18)) + .calcula(); + + assertTrue(estimativa.get(0).isEstimativaValida()); + System.out.println(estimativa); + } + + @Test + public void deveriaCalcularPrecoEPrazoAdicionandoServicoMaoPropria() { + List estimativa = correiosEstimativaAPI.estimaPrecoEPrazo() + .de(new Cep("11015231")) + .para(new Cep("11045530")) + .comServicos("04510") + .comDimensoesDePacote(dimensoesPacoteEstimado) + .comValorDeclarado(BigDecimal.valueOf(18)) + .adicionandoServicoMaoPropria() + .calcula(); + + assertTrue(estimativa.get(0).isEstimativaValida()); + System.out.println(estimativa); + } + + @Test + public void deveriaCalcularPrecoEPrazoAdicionandoServicoAvisoRecebimento() { + List estimativa = correiosEstimativaAPI.estimaPrecoEPrazo() + .de(new Cep("11015231")) + .para(new Cep("11045530")) + .comServicos("04510") + .comDimensoesDePacote(dimensoesPacoteEstimado) + .comValorDeclarado(BigDecimal.valueOf(18)) + .adicionandoServicoAvisoDeRecebimento() + .calcula(); + + assertTrue(estimativa.get(0).isEstimativaValida()); + System.out.println(estimativa); + } + + @Test + public void deveriaCalcularPrecoEPrazoAdicionandoServicoMaoPropriaEAvisoRecebimento() { + List estimativa = correiosEstimativaAPI.estimaPrecoEPrazo() + .de(new Cep("11015231")) + .para(new Cep("11045530")) + .comServicos("04510") + .comDimensoesDePacote(dimensoesPacoteEstimado) + .comValorDeclarado(BigDecimal.valueOf(18)) + .adicionandoServicoMaoPropria() + .adicionandoServicoAvisoDeRecebimento() + .calcula(); + + assertTrue(estimativa.get(0).isEstimativaValida()); + System.out.println(estimativa); + } + + @Test + public void deveriaCalcularPrazo() { + List estimativa = correiosEstimativaAPI.estimaPrazo() + .de(new Cep("11015231")) + .para(new Cep("11045530")) + .comServicos("04510", "12345") + .calcula(); + + assertTrue(estimativa.get(0).isEstimativaValida()); + assertFalse(estimativa.get(1).isEstimativaValida()); + System.out.println(estimativa); + } + +} diff --git a/src/test/java/br/com/correios/api/estimativa/SoapCorreiosServicoEstimativaAPITest.java b/src/test/java/br/com/correios/api/estimativa/SoapCorreiosServicoEstimativaAPITest.java new file mode 100644 index 0000000..6d7b058 --- /dev/null +++ b/src/test/java/br/com/correios/api/estimativa/SoapCorreiosServicoEstimativaAPITest.java @@ -0,0 +1,83 @@ +package br.com.correios.api.estimativa; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.only; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.math.BigDecimal; +import java.util.Collections; +import java.util.Set; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import br.com.correios.Cep; +import br.com.correios.api.postagem.dimensao.DimensoesDoObjeto.TipoDoObjetoSendoEnviado; +import br.com.correios.credentials.CorreiosCredenciais; +import br.com.correios.estimativa.CResultadoToEstimativasConverter; +import br.com.correios.estimativa.DimensoesPacoteEstimado; +import br.com.correios.estimativa.EstimativaComPrazo; +import br.com.correios.estimativa.EstimativaComPrecoEPrazo; +import br.com.correios.webservice.estimativa.CalcPrecoPrazoWS; +import br.com.correios.webservice.estimativa.CalcPrecoPrazoWSSoap; + +@RunWith(MockitoJUnitRunner.class) +public class SoapCorreiosServicoEstimativaAPITest { + + @Mock + private CResultadoToEstimativasConverter precoPrazoConverter; + @Mock + private CResultadoToEstimativasConverter prazoConverter; + @Mock + private DimensoesPacoteEstimado dimensoes; + @Mock + private CalcPrecoPrazoWS calcPrecoPrazoWS; + @Mock + private CalcPrecoPrazoWSSoap calcPrecoPrazoWSSoap; + @Mock + private EstimativaComPrecoEPrazo estimativaComPrecoEPrazo; + @Mock + private EstimativaComPrazo estimativaComPrazo; + + private SoapCorreiosServicoEstimativaAPI soapCorreiosServicoEstimativaAPI; + private Set codigosServico; + + @Before + public void setUp() { + CorreiosCredenciais correiosCredenciais = new CorreiosCredenciais("usuario", "senha"); + soapCorreiosServicoEstimativaAPI = new SoapCorreiosServicoEstimativaAPI(calcPrecoPrazoWS, correiosCredenciais, precoPrazoConverter, prazoConverter); + codigosServico = Collections.singleton("04162"); + + when(calcPrecoPrazoWS.getCalcPrecoPrazoWSSoap()).thenReturn(calcPrecoPrazoWSSoap); + when(dimensoes.getTipoDoObjetoSendoEnviado()).thenReturn(TipoDoObjetoSendoEnviado.PACOTE_OU_CAIXA); + when(dimensoes.getPeso()).thenReturn(BigDecimal.TEN); + when(precoPrazoConverter.convert(any())).thenReturn(Collections.singletonList(estimativaComPrecoEPrazo)); + when(prazoConverter.convert(any())).thenReturn(Collections.singletonList(estimativaComPrazo)); + } + + @Test + public void deveriaCalcularPrecoEPrazoEConverterParaModelo() { + soapCorreiosServicoEstimativaAPI.calculaPrecoEPrazo(codigosServico, new Cep("11045530"), new Cep("11015231"), dimensoes, BigDecimal.TEN, false, false); + + verify(calcPrecoPrazoWSSoap, only()).calcPrecoPrazo(anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), any(), any(), any(), any(), anyString(), any(), anyString()); + verify(precoPrazoConverter).convert(any()); + verify(prazoConverter, never()).convert(any()); + } + + @Test + public void deveriaCalcularPrazoEConverterParaModelo() { + soapCorreiosServicoEstimativaAPI.calculaPrazo(codigosServico, new Cep("11045530"), new Cep("11015231")); + + verify(calcPrecoPrazoWSSoap, only()).calcPrazo(anyString(), anyString(), anyString()); + verify(prazoConverter).convert(any()); + verify(precoPrazoConverter, never()).convert(any()); + } + +} diff --git a/src/test/java/br/com/correios/estimativa/CResultadoToEstimativasConverterTest.java b/src/test/java/br/com/correios/estimativa/CResultadoToEstimativasConverterTest.java new file mode 100644 index 0000000..2030648 --- /dev/null +++ b/src/test/java/br/com/correios/estimativa/CResultadoToEstimativasConverterTest.java @@ -0,0 +1,58 @@ +package br.com.correios.estimativa; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import br.com.correios.api.converter.Converter; +import br.com.correios.webservice.estimativa.CResultado; +import br.com.correios.webservice.estimativa.CServico; + +@RunWith(MockitoJUnitRunner.class) +public class CResultadoToEstimativasConverterTest { + + @Mock + private Converter converterServicoPrecoEPrazo; + @Mock + private Converter converterServicoPrazo; + @Mock(answer=Answers.RETURNS_DEEP_STUBS) + private CResultado cResultado; + + @Test + public void deveriaConverterCResultadoEmListaDeEstimativasDePrecoEPrazo() { + CServico servico = new CServico(); + when(cResultado.getServicos().getCServico()).thenReturn(Arrays.asList(servico, servico)); + + CResultadoToEstimativasConverter converter = new CResultadoToEstimativasConverter<>(converterServicoPrecoEPrazo); + + List estimativas = converter.convert(cResultado); + + assertEquals(2, estimativas.size()); + verify(converterServicoPrecoEPrazo, times(2)).convert(any()); + } + + @Test + public void deveriaConverterCResultadoEmListaDeEstimativasDePrazo() { + CServico servico = new CServico(); + when(cResultado.getServicos().getCServico()).thenReturn(Arrays.asList(servico, servico)); + + CResultadoToEstimativasConverter converter = new CResultadoToEstimativasConverter<>(converterServicoPrazo); + + List estimativas = converter.convert(cResultado); + + assertEquals(2, estimativas.size()); + verify(converterServicoPrazo, times(2)).convert(any()); + } + +} diff --git a/src/test/java/br/com/correios/estimativa/CServicoToEstimativaComPrazoConverterTest.java b/src/test/java/br/com/correios/estimativa/CServicoToEstimativaComPrazoConverterTest.java new file mode 100644 index 0000000..574e9bc --- /dev/null +++ b/src/test/java/br/com/correios/estimativa/CServicoToEstimativaComPrazoConverterTest.java @@ -0,0 +1,62 @@ +package br.com.correios.estimativa; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +import br.com.correios.webservice.estimativa.CServico; + +public class CServicoToEstimativaComPrazoConverterTest { + + private CServicoToEstimativaComPrazoConverter converter; + private CServico servico; + + @Before + public void setup() { + converter = new CServicoToEstimativaComPrazoConverter(); + servico = new CServico(); + } + + @Test + public void deveriaConverterServicoEmEstimativaComPrazo() { + servico.setCodigo(4669); + servico.setEntregaDomiciliar("S"); + servico.setEntregaSabado("N"); + servico.setPrazoEntrega("5"); + servico.setErro("0"); + servico.setMsgErro(null); + + EstimativaComPrazo estimativa = converter.convert(servico); + + assertEquals("04669", estimativa.getCodigoServico()); + assertEquals(Integer.valueOf(5), estimativa.getPrazoEntrega()); + assertTrue(estimativa.isEntregaDomiciliar()); + assertFalse(estimativa.isEntregaAosSabados()); + assertEquals("0", estimativa.getCodigoErro()); + assertNull(estimativa.getMensagemErro()); + } + + @Test + public void deveriaConverterServicoEmEstimativaComPrazoMesmoQuandoEstimativaForInvalida() { + servico.setCodigo(4669); + servico.setEntregaDomiciliar(null); + servico.setEntregaSabado(null); + servico.setPrazoEntrega("0"); + servico.setErro("002"); + servico.setMsgErro("CEP de origem invalido"); + + EstimativaComPrazo estimativa = converter.convert(servico); + + assertEquals("04669", estimativa.getCodigoServico()); + assertEquals(Integer.valueOf(0), estimativa.getPrazoEntrega()); + assertFalse(estimativa.isEntregaDomiciliar()); + assertFalse(estimativa.isEntregaAosSabados()); + assertEquals("002", estimativa.getCodigoErro()); + assertEquals("CEP de origem invalido", estimativa.getMensagemErro()); + } + +} diff --git a/src/test/java/br/com/correios/estimativa/CServicoToEstimativaComPrecoEPrazoConverterTest.java b/src/test/java/br/com/correios/estimativa/CServicoToEstimativaComPrecoEPrazoConverterTest.java new file mode 100644 index 0000000..488a2a4 --- /dev/null +++ b/src/test/java/br/com/correios/estimativa/CServicoToEstimativaComPrecoEPrazoConverterTest.java @@ -0,0 +1,82 @@ +package br.com.correios.estimativa; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +import br.com.correios.webservice.estimativa.CServico; + +public class CServicoToEstimativaComPrecoEPrazoConverterTest { + + private CServicoToEstimativaComPrecoEPrazoConverter converter; + private CServico servico; + + @Before + public void setUp() { + converter = new CServicoToEstimativaComPrecoEPrazoConverter(); + servico = new CServico(); + } + + @Test + public void deveriaConverterServicoEmEstimativaComPrecoEPrazo() { + servico.setCodigo(4669); + servico.setEntregaDomiciliar("S"); + servico.setEntregaSabado("N"); + servico.setPrazoEntrega("5"); + servico.setValor("7,50"); + servico.setValorAvisoRecebimento("0,00"); + servico.setValorMaoPropria("0,00"); + servico.setValorValorDeclarado("1,50"); + servico.setValorSemAdicionais("7,50"); + servico.setErro("0"); + servico.setMsgErro(null); + + EstimativaComPrecoEPrazo estimativa = converter.convert(servico); + + assertEquals("04669", estimativa.getCodigoServico()); + assertEquals(Integer.valueOf(5), estimativa.getPrazoEntrega()); + assertEquals("7,50", estimativa.getValor()); + assertEquals("0,00", estimativa.getValorServicoAvisoDeRecebimento()); + assertEquals("1,50", estimativa.getValorSeguro()); + assertEquals("0,00", estimativa.getValorServicoMaoPropria()); + assertEquals("7,50", estimativa.getValorSemAdicionais()); + assertTrue(estimativa.isEntregaDomiciliar()); + assertFalse(estimativa.isEntregaAosSabados()); + assertEquals("0", estimativa.getCodigoErro()); + assertNull(estimativa.getMensagemErro()); + } + + @Test + public void deveriaConverterServicoEmEstimativaComPrecoEPrazoMesmoQuandoEstimativaForInvalida() { + servico.setCodigo(4669); + servico.setEntregaDomiciliar(null); + servico.setEntregaSabado(null); + servico.setPrazoEntrega("0"); + servico.setValor("0,00"); + servico.setValorAvisoRecebimento("0,00"); + servico.setValorValorDeclarado("0,00"); + servico.setValorMaoPropria("0,00"); + servico.setValorSemAdicionais("0,00"); + servico.setErro("-20"); + servico.setMsgErro("A largura nao pode ser inferior a 11 cm."); + + EstimativaComPrecoEPrazo estimativa = converter.convert(servico); + + assertEquals("04669", estimativa.getCodigoServico()); + assertEquals(Integer.valueOf(0), estimativa.getPrazoEntrega()); + assertEquals("0,00", estimativa.getValor()); + assertEquals("0,00", estimativa.getValorServicoAvisoDeRecebimento()); + assertEquals("0,00", estimativa.getValorSeguro()); + assertEquals("0,00", estimativa.getValorServicoMaoPropria()); + assertEquals("0,00", estimativa.getValorSemAdicionais()); + assertFalse(estimativa.isEntregaDomiciliar()); + assertFalse(estimativa.isEntregaAosSabados()); + assertEquals("-20", estimativa.getCodigoErro()); + assertEquals("A largura nao pode ser inferior a 11 cm.", estimativa.getMensagemErro()); + } + +} diff --git a/src/test/java/br/com/correios/estimativa/DimensoesPacoteEstimadoTest.java b/src/test/java/br/com/correios/estimativa/DimensoesPacoteEstimadoTest.java new file mode 100644 index 0000000..805060a --- /dev/null +++ b/src/test/java/br/com/correios/estimativa/DimensoesPacoteEstimadoTest.java @@ -0,0 +1,50 @@ +package br.com.correios.estimativa; + +import static org.junit.Assert.assertEquals; + +import java.math.BigDecimal; + +import org.junit.Test; + +import br.com.correios.api.postagem.dimensao.DimensoesDoObjeto.TipoDoObjetoSendoEnviado; + +public class DimensoesPacoteEstimadoTest { + + @Test + public void deveriaMontarDimensoesUsandoBuilder() { + DimensoesPacoteEstimado dimensoesPacoteEstimado = DimensoesPacoteEstimado.builder() + .comTipoDeObjeto(TipoDoObjetoSendoEnviado.PACOTE_OU_CAIXA) + .comPeso(BigDecimal.ONE) + .comComprimento(BigDecimal.valueOf(2)) + .comAltura(BigDecimal.valueOf(3)) + .comLargura(BigDecimal.valueOf(4)) + .montaDimensoes(); + + assertEquals(TipoDoObjetoSendoEnviado.PACOTE_OU_CAIXA, dimensoesPacoteEstimado.getTipoDoObjetoSendoEnviado()); + assertEquals(BigDecimal.ONE, dimensoesPacoteEstimado.getPeso()); + assertEquals(BigDecimal.valueOf(2), dimensoesPacoteEstimado.getComprimento()); + assertEquals(BigDecimal.valueOf(3), dimensoesPacoteEstimado.getAltura()); + assertEquals(BigDecimal.valueOf(4), dimensoesPacoteEstimado.getLargura()); + assertEquals(BigDecimal.ZERO, dimensoesPacoteEstimado.getDiametro()); + } + + @Test + public void deveriaMontarDimensoesPodendoUsarDiametroTambem() { + DimensoesPacoteEstimado dimensoesPacoteEstimado = DimensoesPacoteEstimado.builder() + .comTipoDeObjeto(TipoDoObjetoSendoEnviado.PACOTE_OU_CAIXA) + .comPeso(BigDecimal.ONE) + .comComprimento(BigDecimal.valueOf(2)) + .comAltura(BigDecimal.valueOf(3)) + .comLargura(BigDecimal.valueOf(4)) + .comDiametro(BigDecimal.valueOf(5)) + .montaDimensoes(); + + assertEquals(TipoDoObjetoSendoEnviado.PACOTE_OU_CAIXA, dimensoesPacoteEstimado.getTipoDoObjetoSendoEnviado()); + assertEquals(BigDecimal.ONE, dimensoesPacoteEstimado.getPeso()); + assertEquals(BigDecimal.valueOf(2), dimensoesPacoteEstimado.getComprimento()); + assertEquals(BigDecimal.valueOf(3), dimensoesPacoteEstimado.getAltura()); + assertEquals(BigDecimal.valueOf(4), dimensoesPacoteEstimado.getLargura()); + assertEquals(BigDecimal.valueOf(5), dimensoesPacoteEstimado.getDiametro()); + } + +} diff --git a/src/test/java/br/com/correios/estimativa/EstimativaComPrazoTest.java b/src/test/java/br/com/correios/estimativa/EstimativaComPrazoTest.java new file mode 100644 index 0000000..2e6a534 --- /dev/null +++ b/src/test/java/br/com/correios/estimativa/EstimativaComPrazoTest.java @@ -0,0 +1,48 @@ +package br.com.correios.estimativa; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +public class EstimativaComPrazoTest { + + private EstimativaComPrazo estimativaComPrazo; + + @Before + public void setUp() { + estimativaComPrazo = new EstimativaComPrazo(); + } + + @Test + public void deveriaMostrarEstimativaInvalidaESemMensagemDeAtencaoQuandoPrazoDeEntregaForZeroETiverMensagemErro() { + estimativaComPrazo.setPrazoEntrega(0); + estimativaComPrazo.setCodigoErro("001"); + estimativaComPrazo.setMensagemErro("Codigo de servico invalido."); + + assertFalse(estimativaComPrazo.isEstimativaValida()); + assertFalse(estimativaComPrazo.possuiMensagemAtencao()); + } + + @Test + public void deveriaMostrarEstimativaValidaEComMensagemDeAtencaoQuandoPrazoDeEntregaForValidoETiverMensagemErro() { + estimativaComPrazo.setPrazoEntrega(5); + estimativaComPrazo.setCodigoErro("010"); + estimativaComPrazo.setMensagemErro("Area de Risco"); + + assertTrue(estimativaComPrazo.isEstimativaValida()); + assertTrue(estimativaComPrazo.possuiMensagemAtencao()); + } + + @Test + public void deveriaMostrarEstimativaValidaESemMensagemDeAtencaoQuandoPrazoDeEntregaForValidoENaoTiverMensagemErro() { + estimativaComPrazo.setPrazoEntrega(5); + estimativaComPrazo.setCodigoErro("0"); + estimativaComPrazo.setMensagemErro(""); + + assertTrue(estimativaComPrazo.isEstimativaValida()); + assertFalse(estimativaComPrazo.possuiMensagemAtencao()); + } + +} diff --git a/src/test/java/br/com/correios/estimativa/EstimativaComPrecoEPrazoTest.java b/src/test/java/br/com/correios/estimativa/EstimativaComPrecoEPrazoTest.java new file mode 100644 index 0000000..10fd427 --- /dev/null +++ b/src/test/java/br/com/correios/estimativa/EstimativaComPrecoEPrazoTest.java @@ -0,0 +1,51 @@ +package br.com.correios.estimativa; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +public class EstimativaComPrecoEPrazoTest { + + private EstimativaComPrecoEPrazo estimativaComPrecoEPrazo; + + @Before + public void setUp() { + estimativaComPrecoEPrazo = new EstimativaComPrecoEPrazo(); + } + + @Test + public void deveriaMostrarEstimativaInvalidaESemMensagemDeAtencaoQuandoPrazoDeEntregaForZeroETiverMensagemErro() { + estimativaComPrecoEPrazo.setValor("0"); + estimativaComPrecoEPrazo.setPrazoEntrega(0); + estimativaComPrecoEPrazo.setCodigoErro("001"); + estimativaComPrecoEPrazo.setMensagemErro("Codigo de servico invalido."); + + assertFalse(estimativaComPrecoEPrazo.isEstimativaValida()); + assertFalse(estimativaComPrecoEPrazo.possuiMensagemAtencao()); + } + + @Test + public void deveriaMostrarEstimativaValidaEComMensagemDeAtencaoQuandoPrazoDeEntregaForValidoETiverMensagemErro() { + estimativaComPrecoEPrazo.setValor("17,20"); + estimativaComPrecoEPrazo.setPrazoEntrega(5); + estimativaComPrecoEPrazo.setCodigoErro("010"); + estimativaComPrecoEPrazo.setMensagemErro("Area de Risco"); + + assertTrue(estimativaComPrecoEPrazo.isEstimativaValida()); + assertTrue(estimativaComPrecoEPrazo.possuiMensagemAtencao()); + } + + @Test + public void deveriaMostrarEstimativaValidaESemMensagemDeAtencaoQuandoPrazoDeEntregaForValidoENaoTiverMensagemErro() { + estimativaComPrecoEPrazo.setValor("17,20"); + estimativaComPrecoEPrazo.setPrazoEntrega(5); + estimativaComPrecoEPrazo.setCodigoErro("0"); + estimativaComPrecoEPrazo.setMensagemErro(""); + + assertTrue(estimativaComPrecoEPrazo.isEstimativaValida()); + assertFalse(estimativaComPrecoEPrazo.possuiMensagemAtencao()); + } + +}