php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69462 __soapCall with a SoapVar that has a namespace but no name crashes
Submitted: 2015-04-15 13:21 UTC Modified: 2015-06-26 20:30 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: jere dot kankaanranta at codecoast dot fi Assigned: cmb (profile)
Status: Closed Package: SOAP related
PHP Version: 5.6.7 OS: CentOS release 6.4 (Final)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jere dot kankaanranta at codecoast dot fi
New email:
PHP Version: OS:

 

 [2015-04-15 13:21 UTC] jere dot kankaanranta at codecoast dot fi
Description:
------------
Calling SoapClient::__soapCall() with a SoapVar that has a namespace but no name causes PHP to segfault. This also happens if the SoapVar is in input headers.

Test script:
---------------
<?php

$client = new \SoapClient('http://www.webservicex.com/globalweather.asmx?wsdl');
$namespace = 'http://www.webserviceX.NET';
$response = $client->__soapCall(
    'GetCitiesByCountry',
    [
        new \SoapVar(
            // [new \SoapVar('United States', XSD_STRING, null, null, 'CountryName', $namespace)], // ok
            [new \SoapVar('United States', XSD_STRING, null, null, null, $namespace)], // segfault
            SOAP_ENC_OBJECT,
            null,
            null,
            'GetCitiesByCountry',
            $namespace
        )
    ]
);

print_r($response);


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-22 03:36 UTC] laruence@php.net
what I got is:

Fatal error: Uncaught SoapFault exception: [Client] Function ("GetCitiesByCountry") is not a valid method for this service in /tmp/1.php:18
Stack trace:
#0 /tmp/1.php(18): SoapClient->__soapCall('GetCitiesByCoun...', Array)
#1 {main}
  thrown in /tmp/1.php on line 18


anything mistake?
 [2015-04-24 13:22 UTC] eescalona at carqualifier dot com
I had the same issue. Almost three trying to figure out what's wrong.

Thanks. At least now I know what's going on.
 [2015-04-27 22:38 UTC] cmb@php.net
I can run the supplied test script (PHP 5.6.8, Windows 7). The
result is:

| PHP Fatal error: Uncaught SoapFault exception: [soap:Server]
| System.Web.Services.Protocols.SoapException: Server was unable to
| process request. ---> System.Data.SqlClient.SqlException:
| Procedure or function 'getWCity' expects parameter '@CountryName',
| which was not supplied.at
| WebServicex.GlobalWeather.GetCitiesByCountry(String CountryName)
| [...]
 [2015-06-25 16:30 UTC] falundir at gmail dot com
PHP 5.6.6: OK
PHP 5.6.7: Segmentation fault
PHP 5.6.8: OK

Error was introduced in commit c8eaca013a3922e8383def6158ece2b63f6ec483 and fixed in commit 76c1ec5e96640e3076c105bde2cccfceb7557690.

Better test script:

$namespace = "http://example.com/ns";

$client = new SoapClient(null, [ 'exceptions' => 1, 'location' => "http://localhost", 'uri' => $namespace ]);

$soapvar = new SoapVar(
	array(
		new SoapVar('value', XSD_STRING, null, null, null, $namespace)
	),
	SOAP_ENC_OBJECT, null, null, 'name', $namespace
);

try {
	$client->__soapCall('method', array($soapvar));
}
catch (Exception $e) {
	echo "good";
}
 [2015-06-26 20:30 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-06-26 20:30 UTC] cmb@php.net
@falundir: Thanks for the investigation. I'll have a look at the
PR.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 12:01:33 2025 UTC