[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/zend/Zend/Soap/Client/ -> Local.php (source)

   1  <?php
   2  /**
   3   * Zend Framework
   4   *
   5   * LICENSE
   6   *
   7   * This source file is subject to the new BSD license that is bundled
   8   * with this package in the file LICENSE.txt.
   9   * It is also available through the world-wide-web at this URL:
  10   * http://framework.zend.com/license/new-bsd
  11   * If you did not receive a copy of the license and are unable to
  12   * obtain it through the world-wide-web, please send an email
  13   * to [email protected] so we can send you a copy immediately.
  14   *
  15   * @category   Zend
  16   * @package    Zend_Soap
  17   * @subpackage Client
  18   * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19   * @license    http://framework.zend.com/license/new-bsd     New BSD License
  20   * @version    $Id$
  21   */
  22  
  23  /** Zend_Soap_Server */
  24  require_once 'Zend/Soap/Server.php';
  25  
  26  /** Zend_Soap_Client */
  27  require_once 'Zend/Soap/Client.php';
  28  
  29  if (extension_loaded('soap')) {
  30  
  31  /**
  32   * Zend_Soap_Client_Local
  33   *
  34   * Class is intended to be used as local SOAP client which works
  35   * with a provided Server object.
  36   *
  37   * Could be used for development or testing purposes.
  38   *
  39   * @category   Zend
  40   * @package    Zend_Soap
  41   * @subpackage Client
  42   */
  43  class Zend_Soap_Client_Local extends Zend_Soap_Client
  44  {
  45      /**
  46       * Server object
  47       *
  48       * @var Zend_Soap_Server
  49       */
  50      protected $_server;
  51  
  52      /**
  53       * Local client constructor
  54       *
  55       * @param Zend_Soap_Server $server
  56       * @param string $wsdl
  57       * @param array $options
  58       */
  59      function __construct(Zend_Soap_Server $server, $wsdl, $options = null)
  60      {
  61          $this->_server = $server;
  62  
  63          // Use Server specified SOAP version as default
  64          $this->setSoapVersion($server->getSoapVersion());
  65  
  66          parent::__construct($wsdl, $options);
  67      }
  68  
  69      /**
  70       * Actual "do request" method.
  71       *
  72       * @internal
  73       * @param Zend_Soap_Client_Common $client
  74       * @param string $request
  75       * @param string $location
  76       * @param string $action
  77       * @param int    $version
  78       * @param int    $one_way
  79       * @return mixed
  80       */
  81      public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null)
  82      {
  83          // Perform request as is
  84          ob_start();
  85          $this->_server->handle($request);
  86          $response = ob_get_contents();
  87          ob_end_clean();
  88  
  89          return $response;
  90      }
  91  }
  92  
  93  } // end if (extension_loaded('soap')


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1