web/lib/Zend/Soap/Client/Local.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     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 license@zend.com 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: Local.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    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')