Proxy.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 AutoDiscover
  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:$
  21. */
  22. class Zend_Soap_Server_Proxy
  23. {
  24. /**
  25. * @var object
  26. */
  27. protected $_service;
  28. /**
  29. * Constructor
  30. *
  31. * @param object $service
  32. */
  33. public function __construct($service)
  34. {
  35. $this->_service = $service;
  36. }
  37. /**
  38. * Proxy for the WS-I compliant call
  39. *
  40. * @param string $name
  41. * @param string $arguments
  42. * @return array
  43. */
  44. public function __call($name, $arguments)
  45. {
  46. $params = array();
  47. if(count($arguments) > 0){
  48. foreach($arguments[0] as $property => $value){
  49. $params[$property] = $value;
  50. }
  51. }
  52. $result = call_user_func_array(array($this->_service, $name), $params);
  53. return array("{$name}Result"=>$result);
  54. }
  55. }