server2.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 UnitTests
  18. * @copyright Copyright (c) 2005-2015 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. require_once "Zend/Soap/AutoDiscover.php";
  23. require_once "Zend/Soap/Server.php";
  24. require_once "Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php";
  25. /**
  26. * @category Zend
  27. * @package Zend_Soap
  28. * @subpackage UnitTests
  29. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. class Zend_Soap_Wsdl_ComplexTypeB
  33. {
  34. /**
  35. * @var string
  36. */
  37. public $bar;
  38. /**
  39. * @var string
  40. */
  41. public $foo;
  42. }
  43. /**
  44. * @category Zend
  45. * @package Zend_Soap
  46. * @subpackage UnitTests
  47. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  48. * @license http://framework.zend.com/license/new-bsd New BSD License
  49. */
  50. class Zend_Soap_Service_Server2
  51. {
  52. /**
  53. * @param string $foo
  54. * @param string $bar
  55. * @return Zend_Soap_Wsdl_ComplexTypeB
  56. */
  57. public function request($foo, $bar)
  58. {
  59. $b = new Zend_Soap_Wsdl_ComplexTypeB();
  60. $b->bar = $bar;
  61. $b->foo = $foo;
  62. return $b;
  63. }
  64. }
  65. if(isset($_GET['wsdl'])) {
  66. $server = new Zend_Soap_AutoDiscover(new Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex());
  67. } else {
  68. $uri = "http://".$_SERVER['HTTP_HOST']."/".$_SERVER['PHP_SELF']."?wsdl";
  69. $server = new Zend_Soap_Server($uri);
  70. }
  71. $server->setClass('Zend_Soap_Service_Server2');
  72. $server->handle();