php.net |  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
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: smr at kerridge dot com
New email:
PHP Version: OS:

 

 [2005-07-18 17:54 UTC] 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 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-18 21:31 UTC] iliaa@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 16:01:31 2024 UTC