web/lib/Zend/Soap/Client.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Soap
    16  * @package    Zend_Soap
    17  * @subpackage Client
    17  * @subpackage Client
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Client.php 24593 2012-01-05 20:35:02Z matthew $
    20  * @version    $Id$
    21  */
    21  */
    22 
    22 
    23 /**
    23 /**
    24  * @see Zend_Soap_Server
    24  * @see Zend_Soap_Server
    25  */
    25  */
    39  * Zend_Soap_Client
    39  * Zend_Soap_Client
    40  *
    40  *
    41  * @category   Zend
    41  * @category   Zend
    42  * @package    Zend_Soap
    42  * @package    Zend_Soap
    43  * @subpackage Client
    43  * @subpackage Client
    44  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    44  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    45  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    45  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    46  */
    46  */
    47 class Zend_Soap_Client
    47 class Zend_Soap_Client
    48 {
    48 {
    49     /**
    49     /**
    87     protected $_connection_timeout  = null;
    87     protected $_connection_timeout  = null;
    88     protected $_stream_context      = null;
    88     protected $_stream_context      = null;
    89     protected $_features            = null;
    89     protected $_features            = null;
    90     protected $_cache_wsdl          = null;
    90     protected $_cache_wsdl          = null;
    91     protected $_user_agent          = null;
    91     protected $_user_agent          = null;
       
    92     protected $_exceptions          = null;
    92 
    93 
    93     /**
    94     /**
    94      * WSDL used to access server
    95      * WSDL used to access server
    95      * It also defines Zend_Soap_Client working mode (WSDL vs non-WSDL)
    96      * It also defines Zend_Soap_Client working mode (WSDL vs non-WSDL)
    96      *
    97      *
   265                     break;
   266                     break;
   266                 case 'useragent':
   267                 case 'useragent':
   267                 case 'userAgent':
   268                 case 'userAgent':
   268                 case 'user_agent':
   269                 case 'user_agent':
   269                     $this->setUserAgent($value);
   270                     $this->setUserAgent($value);
       
   271                     break;
       
   272                 case 'exceptions':
       
   273                     $this->setExceptions($value);
   270                     break;
   274                     break;
   271 
   275 
   272                 // Not used now
   276                 // Not used now
   273                 // case 'connection_timeout':
   277                 // case 'connection_timeout':
   274                 //     $this->_connection_timeout = $value;
   278                 //     $this->_connection_timeout = $value;
   313         //$options['connection_timeout'] = $this->_connection_timeout;
   317         //$options['connection_timeout'] = $this->_connection_timeout;
   314         $options['stream_context'] = $this->getStreamContext();
   318         $options['stream_context'] = $this->getStreamContext();
   315         $options['cache_wsdl']     = $this->getWsdlCache();
   319         $options['cache_wsdl']     = $this->getWsdlCache();
   316         $options['features']       = $this->getSoapFeatures();
   320         $options['features']       = $this->getSoapFeatures();
   317         $options['user_agent']     = $this->getUserAgent();
   321         $options['user_agent']     = $this->getUserAgent();
       
   322         $options['exceptions']     = $this->getExceptions();
   318 
   323 
   319         foreach ($options as $key => $value) {
   324         foreach ($options as $key => $value) {
   320             /*
   325             /*
   321              * ugly hack as I don't know if checking for '=== null'
   326              * ugly hack as I don't know if checking for '=== null'
   322              * breaks some other option
   327              * breaks some other option
   323              */
   328              */
   324             if (in_array($key, array('user_agent', 'cache_wsdl', 'compression'))) {
   329             if (in_array($key, array('user_agent', 'cache_wsdl', 'compression', 'exceptions'))) {
   325                 if ($value === null) {
   330                 if ($value === null) {
   326                     unset($options[$key]);
   331                     unset($options[$key]);
   327                 }
   332                 }
   328             } else {
   333             } else {
   329                 if ($value == null) {
   334                 if ($value == null) {
   904      * @return string|null
   909      * @return string|null
   905      */
   910      */
   906     public function getUserAgent()
   911     public function getUserAgent()
   907     {
   912     {
   908         return $this->_user_agent;
   913         return $this->_user_agent;
       
   914     }
       
   915 
       
   916     /**
       
   917      * Set the exceptions option
       
   918      *
       
   919      * The exceptions option is a boolean value defining whether soap errors
       
   920      * throw exceptions.
       
   921      *
       
   922      * @see http://php.net/manual/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters
       
   923      *
       
   924      * @param bool $exceptions
       
   925      * @return $this
       
   926      */
       
   927     public function setExceptions($exceptions)
       
   928     {
       
   929         $this->_exceptions = (bool) $exceptions;
       
   930 
       
   931         return $this;
       
   932     }
       
   933 
       
   934     /**
       
   935      * Get the exceptions option
       
   936      *
       
   937      * The exceptions option is a boolean value defining whether soap errors
       
   938      * throw exceptions.
       
   939      *
       
   940      * @see http://php.net/manual/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters
       
   941      *
       
   942      * @return bool|null
       
   943      */
       
   944     public function getExceptions()
       
   945     {
       
   946         return $this->_exceptions;
   909     }
   947     }
   910 
   948 
   911     /**
   949     /**
   912      * Retrieve request XML
   950      * Retrieve request XML
   913      *
   951      *