2
0

Common.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. if (extension_loaded('soap')) {
  22. /**
  23. * @category Zend
  24. * @package Zend_Soap
  25. * @subpackage Client
  26. */
  27. class Zend_Soap_Client_Common extends SoapClient
  28. {
  29. /**
  30. * doRequest() pre-processing method
  31. *
  32. * @var callback
  33. */
  34. protected $_doRequestCallback;
  35. /**
  36. * Common Soap Client constructor
  37. *
  38. * @param callback $doRequestMethod
  39. * @param string $wsdl
  40. * @param array $options
  41. */
  42. function __construct($doRequestCallback, $wsdl, $options)
  43. {
  44. $this->_doRequestCallback = $doRequestCallback;
  45. parent::__construct($wsdl, $options);
  46. }
  47. /**
  48. * Performs SOAP request over HTTP.
  49. * Overridden to implement different transport layers, perform additional XML processing or other purpose.
  50. *
  51. * @param string $request
  52. * @param string $location
  53. * @param string $action
  54. * @param int $version
  55. * @param int $one_way
  56. * @return mixed
  57. */
  58. function __doRequest($request, $location, $action, $version, $one_way = null)
  59. {
  60. if ($one_way === null) {
  61. return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version);
  62. } else {
  63. return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version, $one_way);
  64. }
  65. }
  66. }
  67. } // end if (extension_loaded('soap')