Ejemplo n.º 1
0
 public function connect()
 {
     $this->open();
     try {
         if (!$this->getFunction()) {
             throw TransferException::functionMandatory();
         }
         $response = $this->soapClient->__call($this->getFunction(), $this->getParameters());
         /*$response_headers_str = $this->pointer->__getLastResponseHeaders();
           $response_headers = $this->_readHeaders($response_headers_str);
           if (!$this->checkResponseToken($response_headers['X-FW-Response'])) {
               throw new WrongDataTransferException('Resposta inv�lida do servidor, entre em contato com a Furac�o');
           }*/
     } catch (TransferException $e) {
         throw $e;
         // se for exception de transfer, lançar do jeito que está
     } catch (\Exception $e) {
         throw TransferException::couldNotTransferData($this->url . ($this->isProxy() ? ' (usando proxy)' : ''), $e->getMessage());
     }
     $this->soapClient = null;
     if (empty($response)) {
         throw TransferException::emptyDataReturned();
     }
     return $response;
 }