public IHttpActionResult PostEncomendas(PedidoTransformacaoECL encomenda) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { if (PriIntegration.GerarGuiaRemessa(encomenda)) { return(Ok()); } else { return(BadRequest()); } } catch (InvalidOperationException e) { return(BadRequest(e.Message)); } catch (Exception e) { return(InternalServerError(e)); } }