bug29844.phpt 838 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #29844 (SOAP doesn't return the result of a valid SOAP request)
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. class hello_world {
  10. public function hello($to) {
  11. return 'Hello ' . $to;
  12. }
  13. }
  14. class LocalSoapClient extends SoapClient {
  15. function __construct($wsdl, $options) {
  16. parent::__construct($wsdl, $options);
  17. $this->server = new SoapServer($wsdl, $options);
  18. $this->server->setClass('hello_world');
  19. }
  20. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  21. ob_start();
  22. $this->server->handle($request);
  23. $response = ob_get_contents();
  24. ob_end_clean();
  25. return $response;
  26. }
  27. }
  28. $client = new LocalSoapClient(__DIR__."/bug29844.wsdl", array("trace"=>1));
  29. var_dump($client->hello('davey'));
  30. ?>
  31. --EXPECT--
  32. string(11) "Hello davey"