Bug #69462 [Com]: __soapCall with a SoapVar that has a namespace but no name crashes

From: Date: Thu, 25 Jun 2015 16:31:01 +0000
Subject: Bug #69462 [Com]: __soapCall with a SoapVar that has a namespace but no name crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193886@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69462&edit=1

 ID:                 69462
 Comment by:         falundir at gmail dot com
 Reported by:        jere dot kankaanranta at codecoast dot fi
 Summary:            __soapCall with a SoapVar that has a namespace but
                     no name crashes
 Status:             Open
 Type:               Bug
 Package:            SOAP related
 Operating System:   CentOS release 6.4 (Final)
 PHP Version:        5.6.7
 Block user comment: N
 Private report:     N

 New Comment:

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";
}


Previous Comments:
------------------------------------------------------------------------
[2015-04-27 22:38:55] 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-04-24 13:22:35] 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-22 03:36:28] 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-15 13:21:38] 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);



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69462&edit=1


Thread (6 messages)

« previous php.bugs (#193886) next »