|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34787 SOAP Client not handling boolean types correctly
Submitted: 2005-10-08 08:00 UTC Modified: 2005-10-09 13:06 UTC
From: marcus at synchromedia dot co dot uk Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5CVS-2005-10-08 (snap) OS: *
Private report: No CVE-ID: None
 [2005-10-08 08:00 UTC] marcus at synchromedia dot co dot uk
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):

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" />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-08 14:26 UTC]
Assigned to the maintainer.
 [2005-10-09 13:06 UTC]
Fixed in CVS HEAD, PHP_5_1 and PHP_5_0.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 21:01:31 2024 UTC