bug42692.phpt 935 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Bug #42692 (Procedure 'int1' not present with doc/lit SoapServer)
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. ini_set('soap.wsdl_cache_enabled','0');
  8. function checkAuth($peid,$auth) {
  9. return $peid;
  10. }
  11. class TestSoap extends SoapClient {
  12. function __construct($wsdl, $options) {
  13. parent::__construct($wsdl, $options);
  14. $this->server = new SoapServer($wsdl, $options);
  15. $this->server->addFunction("checkAuth");
  16. }
  17. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  18. ob_start();
  19. $this->server->handle($request);
  20. $response = ob_get_contents();
  21. ob_end_clean();
  22. return $response;
  23. }
  24. }
  25. $client = new TestSoap(__DIR__ . "/bug42692.wsdl", array("trace"=>1));
  26. try {
  27. $result = $client->checkAuth(1,"two");
  28. echo "Auth for 1 is $result\n";
  29. } catch (Exception $e) {
  30. echo $e->getMessage();
  31. }
  32. ?>
  33. --EXPECT--
  34. Auth for 1 is 1