PageRenderTime 83ms CodeModel.GetById 6ms RepoModel.GetById 0ms app.codeStats 0ms

/library/Zend/Soap/Client/Local.php

https://bitbucket.org/ksekar/campus
PHP | 92 lines | 22 code | 10 blank | 60 comment | 1 complexity | a295d2f0e41bd534ff85a07780ebd13c MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.0, MIT
  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-2012 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 24594 2012-01-05 21:27:01Z matthew $
  21. */
  22. /** Zend_Soap_Server */
  23. require_once 'Zend/Soap/Server.php';
  24. /** Zend_Soap_Client */
  25. require_once 'Zend/Soap/Client.php';
  26. if (extension_loaded('soap')) {
  27. /**
  28. * Zend_Soap_Client_Local
  29. *
  30. * Class is intended to be used as local SOAP client which works
  31. * with a provided Server object.
  32. *
  33. * Could be used for development or testing purposes.
  34. *
  35. * @category Zend
  36. * @package Zend_Soap
  37. * @subpackage Client
  38. */
  39. class Zend_Soap_Client_Local extends Zend_Soap_Client
  40. {
  41. /**
  42. * Server object
  43. *
  44. * @var Zend_Soap_Server
  45. */
  46. protected $_server;
  47. /**
  48. * Local client constructor
  49. *
  50. * @param Zend_Soap_Server $server
  51. * @param string $wsdl
  52. * @param array $options
  53. */
  54. function __construct(Zend_Soap_Server $server, $wsdl, $options = null)
  55. {
  56. $this->_server = $server;
  57. // Use Server specified SOAP version as default
  58. $this->setSoapVersion($server->getSoapVersion());
  59. parent::__construct($wsdl, $options);
  60. }
  61. /**
  62. * Actual "do request" method.
  63. *
  64. * @internal
  65. * @param Zend_Soap_Client_Common $client
  66. * @param string $request
  67. * @param string $location
  68. * @param string $action
  69. * @param int $version
  70. * @param int $one_way
  71. * @return mixed
  72. */
  73. public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null)
  74. {
  75. // Perform request as is
  76. ob_start();
  77. $this->_server->handle($request);
  78. $response = ob_get_clean();
  79. return $response;
  80. }
  81. }
  82. } // end if (extension_loaded('soap')