From:             marcus at synchromedia dot co dot uk
Operating system: n/a
PHP version:      5CVS-2005-10-08 (snap)
PHP Bug Type:     SOAP related
Bug description:  SOAP Client not handling boolean types correctly

Description:
------------
This is a re-report of bug 33753 which was closed as bogus,
and it's not the same problem as bug 33602. It's not bogus,
it's a problem with PHP's WSDL handling.

This is nothing to do with how PHP normally presents true
and false values as strings, but how it deals with WSDL
definitions. The WSDL is asking for xsd's representation of
a boolean, not PHP's, and thus PHP's disregard for this is
a bug. The line in the XMLSchema datatypes DTD is:

<!ENTITY % boolean "(true|false)">

and the XMLSchema spec says:

"An instance of a datatype that is defined as ·boolean· can
have the following legal literals {true, false, 1, 0}."

So PHP's output is not compatible with XMLSchema.

You may still consider that bogus, but that's kind of
academic - the upshot is that the SOAP implementation is
broken in this respect as it is disobeying what the WSDL
asks for. Because of this behaviour, SOAP calls generated
by PHP are likely to fail (as in the original bug report)
as they are generating XML that does not conform to the
namespaces they reference.

I can understand that it may be sensible to provide values
to the SOAP client in the expected format for a given
namespace (which is what Ilia suggested for bug 33753), but
we don't always have that option - in the case I have, the
values are being generated by PHP from the WSDL and NOT
from any data that I'm submitting, so I have no control
over it, so it must be fixed within PHP.

Reproduce code:
---------------
Examples on these pages demonstrate the bug in action (though that's not
what they set out to do):

http://suraski.net/blog/index.php?/archives/5-PHP-5s-SOAP-extension-and-SalesForce.html
http://www.schlossnagle.org/~george/blog/index.php?/archives/235-Salesforce.com-and-PHP.html

Expected result:
----------------
An unset value of type xsd:boolean in some arbitrary namespace 
ns1 should be rendered as:

<ns1:someelement xsi:nil="true" />

Actual result:
--------------
<ns1:someelement xsi:nil="1" />

-- 
Edit bug report at http://bugs.php.net/?id=34787&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34787&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34787&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34787&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34787&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34787&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34787&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34787&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34787&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34787&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34787&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34787&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34787&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34787&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34787&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34787&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34787&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34787&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34787&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34787&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34787&r=mysqlcfg

Reply via email to