import v1.0.0-RC4 | 2009-05-20
This commit is contained in:
73
libs/Zend/Soap/Client/Common.php
Normal file
73
libs/Zend/Soap/Client/Common.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
||||
if (extension_loaded('soap')) {
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
*/
|
||||
class Zend_Soap_Client_Common extends SoapClient
|
||||
{
|
||||
/**
|
||||
* doRequest() pre-processing method
|
||||
*
|
||||
* @var callback
|
||||
*/
|
||||
protected $_doRequestCallback;
|
||||
|
||||
/**
|
||||
* Common Soap Client constructor
|
||||
*
|
||||
* @param callback $doRequestMethod
|
||||
* @param string $wsdl
|
||||
* @param array $options
|
||||
*/
|
||||
function __construct($doRequestCallback, $wsdl, $options)
|
||||
{
|
||||
$this->_doRequestCallback = $doRequestCallback;
|
||||
|
||||
parent::__construct($wsdl, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs SOAP request over HTTP.
|
||||
* Overridden to implement different transport layers, perform additional XML processing or other purpose.
|
||||
*
|
||||
* @param string $request
|
||||
* @param string $location
|
||||
* @param string $action
|
||||
* @param int $version
|
||||
* @param int $one_way
|
||||
* @return mixed
|
||||
*/
|
||||
function __doRequest($request, $location, $action, $version, $one_way = null)
|
||||
{
|
||||
if ($one_way === null) {
|
||||
return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version);
|
||||
} else {
|
||||
return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version, $one_way);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // end if (extension_loaded('soap')
|
88
libs/Zend/Soap/Client/DotNet.php
Normal file
88
libs/Zend/Soap/Client/DotNet.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/** Zend_Soap_Client_Exception */
|
||||
require_once 'Zend/Soap/Client/Exception.php';
|
||||
|
||||
/** Zend_Soap_Client */
|
||||
require_once 'Zend/Soap/Client.php';
|
||||
|
||||
|
||||
if (extension_loaded('soap')) {
|
||||
|
||||
/**
|
||||
* Zend_Soap_Client_Local
|
||||
*
|
||||
* Class is intended to be used with .Net Web Services.
|
||||
*
|
||||
* Important! Class is at experimental stage now.
|
||||
* Please leave your notes, compatiblity issues reports or
|
||||
* suggestions in fw-webservices@lists.zend.com or fw-general@lists.com
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
*/
|
||||
class Zend_Soap_Client_DotNet extends Zend_Soap_Client
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $wsdl
|
||||
* @param array $options
|
||||
*/
|
||||
public function __construct($wsdl = null, $options = null)
|
||||
{
|
||||
// Use SOAP 1.1 as default
|
||||
$this->setSoapVersion(SOAP_1_1);
|
||||
|
||||
parent::__construct($wsdl, $options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform arguments pre-processing
|
||||
*
|
||||
* My be overridden in descendant classes
|
||||
*
|
||||
* @param array $arguments
|
||||
*/
|
||||
protected function _preProcessArguments($arguments)
|
||||
{
|
||||
// Do nothing
|
||||
return array($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform result pre-processing
|
||||
*
|
||||
* My be overridden in descendant classes
|
||||
*
|
||||
* @param array $arguments
|
||||
*/
|
||||
protected function _preProcessResult($result)
|
||||
{
|
||||
$resultProperty = $this->getLastMethod() . 'Result';
|
||||
|
||||
return $result->$resultProperty;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // end if (extension_loaded('soap')
|
33
libs/Zend/Soap/Client/Exception.php
Normal file
33
libs/Zend/Soap/Client/Exception.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/** Zend_Exception */
|
||||
require_once 'Zend/Exception.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 8064 2008-02-16 10:58:39Z thomas $
|
||||
*/
|
||||
class Zend_Soap_Client_Exception extends Zend_Exception
|
||||
{}
|
||||
|
95
libs/Zend/Soap/Client/Local.php
Normal file
95
libs/Zend/Soap/Client/Local.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/** Zend_Soap_Client_Exception */
|
||||
require_once 'Zend/Soap/Server/Exception.php';
|
||||
|
||||
|
||||
/** Zend_Soap_Server */
|
||||
require_once 'Zend/Soap/Server.php';
|
||||
|
||||
/** Zend_Soap_Client */
|
||||
require_once 'Zend/Soap/Client.php';
|
||||
|
||||
|
||||
if (extension_loaded('soap')) {
|
||||
|
||||
/**
|
||||
* Zend_Soap_Client_Local
|
||||
*
|
||||
* Class is intended to be used as local SOAP client which works
|
||||
* with a provided Server object.
|
||||
*
|
||||
* Could be used for development or testing purposes.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
*/
|
||||
class Zend_Soap_Client_Local extends Zend_Soap_Client
|
||||
{
|
||||
/**
|
||||
* Server object
|
||||
*
|
||||
* @var Zend_Soap_Server
|
||||
*/
|
||||
protected $_server;
|
||||
|
||||
/**
|
||||
* Local client constructor
|
||||
*
|
||||
* @param Zend_Soap_Server $server
|
||||
* @param string $wsdl
|
||||
* @param array $options
|
||||
*/
|
||||
function __construct(Zend_Soap_Server $server, $wsdl, $options = null)
|
||||
{
|
||||
$this->_server = $server;
|
||||
|
||||
// Use Server specified SOAP version as default
|
||||
$this->setSoapVersion($server->getSoapVersion());
|
||||
|
||||
parent::__construct($wsdl, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actual "do request" method.
|
||||
*
|
||||
* @internal
|
||||
* @param Zend_Soap_Client_Common $client
|
||||
* @param string $request
|
||||
* @param string $location
|
||||
* @param string $action
|
||||
* @param int $version
|
||||
* @param int $one_way
|
||||
* @return mixed
|
||||
*/
|
||||
public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null)
|
||||
{
|
||||
// Perform request as is
|
||||
ob_start();
|
||||
$this->_server->handle($request);
|
||||
$response = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
} // end if (extension_loaded('soap')
|
Reference in New Issue
Block a user