Exemplo n.º 1
0
 /**
  * Set credentials for HTTP Auth Basic
  *
  * @param string $username
  * @param string $password
  * @return Dhl_Account_Model_Http_Adapter
  * @throws Dhl_Account_Exception
  */
 public function setAuth($username, $password)
 {
     parent::setAuth($username, $password);
     try {
         $this->getClient()->setAuth($this->username, $this->password);
     } catch (Zend_Http_Client_Exception $e) {
         throw new Dhl_Account_Exception($e->getMessage(), $e->getCode());
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Set credentials for HTTP Auth Basic to REST client
  *
  * @param string $username
  * @param string $password
  * @return Dhl_Account_Model_Webservice_Client_Abstract
  */
 public function setAuth($username, $password)
 {
     parent::setAuth($username, $password);
     $this->client->getHttpClient()->setAuth($this->username, $this->password);
     return $this;
 }