server1.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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_Service_Server1
  33. {
  34. /**
  35. * @param Zend_Soap_Wsdl_ComplexTypeB
  36. * @return Zend_Soap_Wsdl_ComplexTypeA[]
  37. */
  38. public function request($request)
  39. {
  40. $a = new Zend_Soap_Wsdl_ComplexTypeA();
  41. $b1 = new Zend_Soap_Wsdl_ComplexTypeB();
  42. $b1->bar = "bar";
  43. $b1->foo = "bar";
  44. $a->baz[] = $b1;
  45. $b2 = new Zend_Soap_Wsdl_ComplexTypeB();
  46. $b2->bar = "foo";
  47. $b2->foo = "foo";
  48. $a->baz[] = $b2;
  49. $a->baz[] = $request;
  50. return array($a);
  51. }
  52. }
  53. /**
  54. * @category Zend
  55. * @package Zend_Soap
  56. * @subpackage UnitTests
  57. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  58. * @license http://framework.zend.com/license/new-bsd New BSD License
  59. */
  60. class Zend_Soap_Wsdl_ComplexTypeB
  61. {
  62. /**
  63. * @var string
  64. */
  65. public $bar;
  66. /**
  67. * @var string
  68. */
  69. public $foo;
  70. }
  71. /**
  72. * @category Zend
  73. * @package Zend_Soap
  74. * @subpackage UnitTests
  75. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  76. * @license http://framework.zend.com/license/new-bsd New BSD License
  77. */
  78. class Zend_Soap_Wsdl_ComplexTypeA
  79. {
  80. /**
  81. * @var Zend_Soap_Wsdl_ComplexTypeB[]
  82. */
  83. public $baz = array();
  84. }
  85. if(isset($_GET['wsdl'])) {
  86. $server = new Zend_Soap_AutoDiscover(new Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex());
  87. } else {
  88. $uri = "http://".$_SERVER['HTTP_HOST']."/".$_SERVER['PHP_SELF']."?wsdl";
  89. $server = new Zend_Soap_Server($uri);
  90. }
  91. $server->setClass('Zend_Soap_Service_Server1');
  92. $server->handle();