|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33753 SOAP Client not parsing boolean types correctly
Submitted: 2005-07-18 17:54 UTC Modified: 2005-07-18 21:31 UTC
From: smr at kerridge dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.1.0b2 OS: Win XP
Private report: No CVE-ID: None
 [2005-07-18 17:54 UTC] smr at kerridge dot com
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:
$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"); 
 $client = new SoapClient("stockquote.wsdl"); 

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 name='getQuoteResponse'> 
  <part name='Result' type='xsd:string'/> 

Expected result:

99.42 And the boolean value is false

Actual result:
99.42 And the boolean value is 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-18 21:31 UTC]
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.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 07:04:07 2022 UTC