|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33602 SoapVar wrongly encodes boolean
Submitted: 2005-07-07 14:52 UTC Modified: 2005-10-09 13:06 UTC
From: sl at yes-co dot nl Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5.0.4 OS: Linux 2.6.8
Private report: No CVE-ID:
 [2005-07-07 14:52 UTC] sl at yes-co dot nl
Putting a value like this in a SOAP response:

	new SoapParam("true", XSD_BOOLEAN)

results in:

	<Foo xsi:type="xsd:boolean">0</Foo>

while it should be

	<Foo xsi:type="xsd:boolean">true</Foo>

Reproduce code:
	$server=new SoapServer(null, Array("uri" => "http://localhost/", "location" => "http://localhost/"));
		<SOAP-ENV:Envelope xmlns:SOAP-ENV="" >
	function Foo() {
		return new SoapVar('true', XSD_BOOLEAN);

Expected result:
<SOAP-ENV:Envelope ...>
			<return xsi:type="xsd:boolean">true</return>

Actual result:
<SOAP-ENV:Envelope ...>
			<return xsi:type="xsd:boolean">0</return>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-07 14:55 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-07-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2005-07-21 10:15 UTC] sl at yes-co dot nl
Confirmed for PHP Version 5.1.0-dev (Jul 21 2005 08:29:50).

new SoapVar('true', XSD_BOOLEAN)
should give:
<return xsi:type="xsd:boolean">true</return>
but gives:
<return xsi:type="xsd:boolean">0</return>
 [2005-07-21 12:14 UTC]

 [2005-07-21 13:14 UTC] sl at yes-co dot nl
This works as expected:
new SoapVar("2001-01-02T18:28:40+01:00", XSD_DATETIME)
The first parameter is put between XML tags, although it is not a PHP type for a date. The string is just put between tags which indicate it is a datetime. Therefore,
new SoapVar("true", XSD_BOOLEAN)
should put "true" between tags which indicate that it is a boolean.
 [2005-10-09 13:06 UTC]
Fixed in CVS HEAD, PHP_5_1 and PHP_5_0.
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Wed Jan 18 12:01:45 2017 UTC