#33753 [Opn->Bgs]: SOAP Client not parsing boolean types correctly

From: Date: Mon, 18 Jul 2005 19:31:24 +0000
Subject: #33753 [Opn->Bgs]: SOAP Client not parsing boolean types correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82090@lists.php.net to get a copy of this message
ID: 33753 Updated by: iliaa@php.net Reported By: smr at kerridge dot com -Status: Open +Status: Bogus Bug Type: SOAP related Operating System: Win XP PHP Version: 5.1.0b2 New Comment: PHP does not print booleans as booleans, it converts them to their string values, 1 for TRUE and '' for FALSE. if you want use the var_dump() function to see what the $booltest variable really contains. Previous Comments: ------------------------------------------------------------------------ [2005-07-18 17:54:31] smr at kerridge dot com Description: ------------ I believe that there is a problem with the SOAP client in that it is not correctly parsing parameters that are specified in teh WSDL as xsd:boolean. The app that I am connecting to requires boolean values of true and false, however PHP soap is translating true to 1 and false to blank/null. Reproduce code: --------------- SoapServer.php <?php $quotes = array( "ibm" => 99.42 ); function getQuote($booltest, $symbol) { global $quotes; return $quotes[$symbol] . " And the boolean value is {$booltest}"; } ini_set("soap.wsdl_cache_enabled", "0"); $server = new SoapServer("stockquote.wsdl"); $server->addFunction("getQuote"); $server->handle(); ?> SoapClient.php <?php $client = new SoapClient("stockquote.wsdl"); print($client->getQuote(false,"ibm")); ?> Expected result: ---------------- NB: You will need to create a WSDL for the above. Use the one from Dmitry Stogov's examples and change: <message name='getQuoteRequest'> <part name='booltest' type='xsd:boolean'/> <part name='symbol' type='xsd:string'/> </message> <message name='getQuoteResponse'> <part name='Result' type='xsd:string'/> </message> Expected result: 99.42 And the boolean value is false Actual result: -------------- 99.42 And the boolean value is ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33753&edit=1

« previous php.bugs (#82090) next »