PHP bug #49013: SOAPClient interprets the parameters array incorrectly

raw

soapclienttest.php

1
2
3
4
5
6
7
8
9
<?php
$sc = new SoapClient(__DIR__ . '/test.wsdl', array('trace' => 1));
$arguments = array(
    'password' => 'password-value',
    'username' => 'username-value',
);
$response = $sc->__soapCall('getInfo', $arguments);
echo htmlspecialchars($sc->__getLastRequest());
?>
raw

test.wsdl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<wsdl:definitions targetNamespace="http://example.org/foo"
                  xmlns:impl="http://example.org/impl"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <wsdl:message name="getInfoRequest">
      <wsdl:part name="username" type="xsd:string"/>
      <wsdl:part name="password" type="xsd:string"/>
   </wsdl:message>
   
   <wsdl:portType name="InfoWs">
      <wsdl:operation name="getInfo">
         <wsdl:input message="impl:getInfoRequest" name="getInfoRequest"/>
      </wsdl:operation>
   </wsdl:portType>
   
   <wsdl:binding name="binding" type="impl:InfoWs">
      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="getInfo">
         <wsdl:input name="getInfoRequest">
            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://example.org/impl" use="encoded"/>
         </wsdl:input>
      </wsdl:operation>
   </wsdl:binding>
   
   <wsdl:service name="service">
      <wsdl:port binding="impl:binding" name="portservice">
         <wsdlsoap:address location="http://example.org/foo"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>
Christian Weiske Christian Weiske
owner

History