/** * Processa a consulta e retorna VERDADEIRO se foi concluída com sucesso. * @return boolean * @access public */ public function processaConsulta() { //Ativa o uso de URL FOpen ini_set("allow_url_fopen", 1); ini_set("soap.wsdl_cache_enabled", 0); //Inicia transação junto a Braspag try { //Verifica se o sistema está online if (@fopen(parent::URL_CALCULADOR, 'r')) { $soap = new SoapClient(parent::URL_CALCULADOR); $retorno = $soap->ConsultaPrazoEntrega((double) $this->cepOrigem, (double) $this->cepDestino, (double) $this->getCnpjEmpresa()); $resultado = array('prazo' => $retorno, 'sucesso' => TRUE, 'mensagem' => ''); $servico = new BraspressPrazoEntregaResultado($resultado); $this->resultado = $servico; } else { return FALSE; } } catch (SoapFault $sf) { $resultado = array('prazo' => 0, 'sucesso' => FALSE, 'mensagem' => $sf->getMessage()); $servico = new BraspressPrazoEntregaResultado($resultado); $this->resultado = $servico; } return TRUE; }