PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://firephp.googlecode.com/
PHP | 95 lines | 24 code | 13 blank | 58 comment | 1 complexity | 49447002c90d459d024aa0448cb52d2a MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.0, MIT, Apache-2.0
  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. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /** Zend_Soap_Client_Exception */
  21. require_once 'Zend/Soap/Server/Exception.php';
  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. */
  38. class Zend_Soap_Client_Local extends Zend_Soap_Client
  39. {
  40. /**
  41. * Server object
  42. *
  43. * @var Zend_Soap_Server
  44. */
  45. protected $_server;
  46. /**
  47. * Local client constructor
  48. *
  49. * @param Zend_Soap_Server $server
  50. * @param string $wsdl
  51. * @param array $options
  52. */
  53. function __construct(Zend_Soap_Server $server, $wsdl, $options = null)
  54. {
  55. $this->_server = $server;
  56. // Use Server specified SOAP version as default
  57. $this->setSoapVersion($server->getSoapVersion());
  58. parent::__construct($wsdl, $options);
  59. }
  60. /**
  61. * Actual "do request" method.
  62. *
  63. * @internal
  64. * @param Zend_Soap_Client_Common $client
  65. * @param string $request
  66. * @param string $location
  67. * @param string $action
  68. * @param int $version
  69. * @param int $one_way
  70. * @return mixed
  71. */
  72. public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null)
  73. {
  74. // Perform request as is
  75. ob_start();
  76. $this->_server->handle($request);
  77. $response = ob_get_contents();
  78. ob_end_clean();
  79. return $response;
  80. }
  81. }
  82. } // end if (extension_loaded('soap')