|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-18 21:31 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
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