From: sl at yes-co dot nl
Operating system: Linux 2.6.8
PHP version: 5.0.4
PHP Bug Type: SOAP related
Bug description: SoapVar wrongly encodes boolean
Description:
------------
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:
---------------
<?php
$server=new SoapServer(null, Array("uri" => "http://localhost/",
"location" => "http://localhost/"));
$server->addFunction(Foo);
$server->handle('
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
<SOAP-ENV:Body>
<m:Foo>
</m:Foo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
');
function Foo() {
return new SoapVar('true', XSD_BOOLEAN);
}
?>
Expected result:
----------------
<SOAP-ENV:Envelope ...>
<SOAP-ENV:Body>
<ns1:FooResponse>
<return xsi:type="xsd:boolean">true</return>
</ns1:FooResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Actual result:
--------------
<SOAP-ENV:Envelope ...>
<SOAP-ENV:Body>
<ns1:FooResponse>
<return xsi:type="xsd:boolean">0</return>
</ns1:FooResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--
Edit bug report at http://bugs.php.net/?id=33602&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33602&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33602&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33602&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33602&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33602&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33602&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33602&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33602&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33602&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33602&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33602&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33602&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33602&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33602&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33602&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33602&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33602&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33602&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33602&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33602&r=mysqlcfg