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