Skip to content

Commit 3fb0f34

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
2 parents 0d273cf + db47e35 commit 3fb0f34

File tree

4 files changed

+146
-2
lines changed

4 files changed

+146
-2
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 7.3.0RC5
44

5+
- SOAP:
6+
. Fixed bug #50675 (SoapClient can't handle object references correctly).
7+
(Cameron Porter)
58

69
25 Oct 2018, PHP 7.3.0RC4
710

ext/soap/php_encoding.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
296296
if (node_ptr == node) {
297297
return 0;
298298
}
299-
xmlNodeSetName(node, node_ptr->name);
300-
xmlSetNs(node, node_ptr->ns);
301299
if (SOAP_GLOBAL(soap_version) == SOAP_1_1) {
302300
while (1) {
303301
attr = get_attribute(attr, "id");

ext/soap/tests/bugs/bug50675.phpt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
--TEST--
2+
Bug #50675 SoapClient can't handle object references correctly.
3+
--SKIPIF--
4+
<?php require_once('skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
8+
class TestSoapClient extends SoapClient {
9+
function __doRequest($request, $location, $action, $version, $one_way = 0) {
10+
return <<<EOF
11+
<?xml version="1.0" encoding="UTF-8"?>
12+
<soapenv:Envelope
13+
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
14+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
15+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
16+
<soapenv:Body>
17+
<soapenv:Fault>
18+
<faultcode>soapenv:Server.userException</faultcode>
19+
<faultstring>service.EchoServiceException</faultstring>
20+
<detail>
21+
<service.EchoServiceException xsi:type="ns1:EchoServiceException" xmlns:ns1="urn:service.EchoService">
22+
<intParameter xsi:type="xsd:int">105</intParameter>
23+
<parameter xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string param</parameter>
24+
</service.EchoServiceException>
25+
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">steckovic</ns2:hostname>
26+
</detail>
27+
</soapenv:Fault>
28+
</soapenv:Body>
29+
</soapenv:Envelope>
30+
EOF;
31+
}
32+
}
33+
34+
ini_set('soap.wsdl_cache_enabled', 0);
35+
36+
$parameters = [
37+
'trace' => 1,
38+
'exceptions' => 0,
39+
];
40+
$client = new TestSoapClient(dirname(__FILE__) . '/bug50675.wsdl', $parameters);
41+
42+
$person = new stdClass();
43+
$person->name = 'name';
44+
45+
$result = $client->echoPerson($person, $person);
46+
47+
print($client->__getLastRequest());
48+
--EXPECT--
49+
<?xml version="1.0" encoding="UTF-8"?>
50+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:service.EchoService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoPerson><p xsi:type="ns2:Person" id="ref1"><name xsi:type="SOAP-ENC:string">name</name></p><p2 href="#ref1"/></ns1:echoPerson></SOAP-ENV:Body></SOAP-ENV:Envelope>

ext/soap/tests/bugs/bug50675.wsdl

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<wsdl:definitions targetNamespace="http://212.24.157.117:8080/axis/services/echo" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://212.24.157.117:8080/axis/services/echo" xmlns:intf="http://212.24.157.117:8080/axis/services/echo" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:service.EchoService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<wsdl:types>
4+
<schema targetNamespace="urn:service.EchoService" xmlns="http://www.w3.org/2001/XMLSchema">
5+
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
6+
<complexType name="EchoServiceException">
7+
<sequence>
8+
<element name="intParameter" type="xsd:int"/>
9+
<element name="parameter" nillable="true" type="soapenc:string"/>
10+
</sequence>
11+
</complexType>
12+
<complexType name="Person">
13+
<sequence>
14+
<element name="name" nillable="true" type="soapenc:string"/>
15+
</sequence>
16+
</complexType>
17+
</schema>
18+
</wsdl:types>
19+
20+
<wsdl:message name="EchoServiceException">
21+
22+
<wsdl:part name="EchoServiceException" type="tns1:EchoServiceException"/>
23+
24+
</wsdl:message>
25+
26+
<wsdl:message name="echoPersonResponse">
27+
28+
<wsdl:part name="echoPersonReturn" type="tns1:Person"/>
29+
30+
</wsdl:message>
31+
32+
<wsdl:message name="echoPersonRequest">
33+
34+
<wsdl:part name="p" type="tns1:Person"/>
35+
<wsdl:part name="p2" type="tns1:Person"/>
36+
37+
</wsdl:message>
38+
39+
<wsdl:portType name="EchoService">
40+
41+
<wsdl:operation name="echoPerson" parameterOrder="p">
42+
43+
<wsdl:input message="impl:echoPersonRequest" name="echoPersonRequest"/>
44+
45+
<wsdl:output message="impl:echoPersonResponse" name="echoPersonResponse"/>
46+
47+
<wsdl:fault message="impl:EchoServiceException" name="EchoServiceException"/>
48+
49+
</wsdl:operation>
50+
51+
</wsdl:portType>
52+
53+
<wsdl:binding name="echoSoapBinding" type="impl:EchoService">
54+
55+
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
56+
57+
<wsdl:operation name="echoPerson">
58+
59+
<wsdlsoap:operation soapAction=""/>
60+
61+
<wsdl:input name="echoPersonRequest">
62+
63+
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://service" use="encoded"/>
64+
65+
</wsdl:input>
66+
67+
<wsdl:output name="echoPersonResponse">
68+
69+
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
70+
71+
</wsdl:output>
72+
73+
<wsdl:fault name="EchoServiceException">
74+
75+
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="EchoServiceException" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
76+
77+
</wsdl:fault>
78+
79+
</wsdl:operation>
80+
81+
</wsdl:binding>
82+
83+
<wsdl:service name="EchoServiceService">
84+
85+
<wsdl:port binding="impl:echoSoapBinding" name="echo">
86+
87+
<wsdlsoap:address location="http://212.24.157.117:8080/axis/services/echo"/>
88+
89+
</wsdl:port>
90+
91+
</wsdl:service>
92+
93+
</wsdl:definitions>

0 commit comments

Comments
 (0)