php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47996 new SOAPVar('false', XSD_BOOLEAN) comes out 'true'
Submitted: 2009-04-16 22:39 UTC Modified: 2009-04-20 16:39 UTC
From: piperj01 at u dot washington dot edu Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.9 OS: Windows 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: piperj01 at u dot washington dot edu
New email:
PHP Version: OS:

 

 [2009-04-16 22:39 UTC] piperj01 at u dot washington dot edu
Description:
------------
Trying to pass a Boolean value as a parameter when invoking a webservices via SOAP. But when using calls like:

new SOAPVar('false', XSD_BOOLEAN, null, null, null, $ns)

The resulting XML shows 'true' not 'false'.

Looks like it is related to bug 33602.  I suspect something to do with soap.c function serialize_function_call() around line 4298. The code there appears to do work related to the 'true' case, but not the 'false' case.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-16 23:49 UTC] piperj01 at u dot washington dot edu
Also, I noticed if I use:

new SOAPVar('', XSD_BOOLEAN, null, null, null, $ns)


That the generated will show up as 'false'. This can be used as a workaround since 'false' doesn't appear to work.
 [2009-04-19 14:34 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You need to pass it boolean FALSE and not string 'false' which is a non-empty string and evaluates to TRUE.
 [2009-04-20 16:39 UTC] piperj01 at u dot washington dot edu
The manual I am looking at http://us.php.net/manual/en/class.soapvar.php

says for the SoapVar constructore:

  SoapVar   {
/* Methods */
__construct ( string $data , string $encoding [, string $type_name [, string $type_namespace [, string $node_name [, string $node_namespace ]]]] )
SoapVar ( string $data , string $encoding [, string $type_name [, string $type_namespace [, string $node_name [, string $node_namespace ]]]] )
}


This looks to me to say that ALL the params to the SoapVar constructors are strings.  Please explain how to know that the param '$data' is to be a Boolean?

Thank you,

Jim
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC