xref: /PHP-8.2/ext/soap/tests/bugs/bug30175.phpt (revision 8ae4b560)
1--TEST--
2Bug #30175 (SOAP results aren't parsed correctly)
3--EXTENSIONS--
4soap
5--INI--
6soap.wsdl_cache_enabled=0
7--FILE--
8<?php
9
10class LocalSoapClient extends SoapClient {
11
12  function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
13    return <<<EOF
14<?xml version="1.0" encoding="UTF-8"?>
15<SOAP-ENV:Envelope
16xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
17xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
18xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19xmlns:xsd="http://www.w3.org/2001/XMLSchema"
20xmlns:ns1="urn:qweb">
21<SOAP-ENV:Body
22SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
23id="_0">
24<ns1:HostInfo xsi:type="ns1:HostInfo">
25<name xsi:type="xsd:string">blah blah some name field</name>
26<shortDescription xsi:type="xsd:string">This is a description. more blah blah blah</shortDescription>
27<ipAddress xsi:type="xsd:string">127.0.0.1</ipAddress>
28</ns1:HostInfo>
29</SOAP-ENV:Body>
30</SOAP-ENV:Envelope>
31EOF;
32  }
33
34}
35
36$client = new LocalSoapClient(__DIR__."/bug30175.wsdl");
37var_dump($client->qwebGetHostInfo());
38?>
39--EXPECT--
40array(3) {
41  ["name"]=>
42  string(25) "blah blah some name field"
43  ["shortDescription"]=>
44  string(42) "This is a description. more blah blah blah"
45  ["ipAddress"]=>
46  string(9) "127.0.0.1"
47}
48