Bug #62378 [Opn->Fbk]: PHP incorrectly encodes null values in SOAP
| From: | cmb@php.net | Date: | Sun, 04 Nov 2018 14:01:13 +0000 |
| Subject: | Bug #62378 [Opn->Fbk]: PHP incorrectly encodes null values in SOAP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-217819@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62378&edit=1
ID: 62378
Updated by: cmb@php.net
Reported by: webmaster at guestwho dot com
Summary: PHP incorrectly encodes null values in SOAP
-Status: Open
+Status: Feedback
Type: Bug
Package: SOAP related
Operating System: FreeBSD 8.3-RELEASE
PHP Version: 5.3.14
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I cannot reproduce the reported behavior. If anybody still can
with any of the actively supported PHP versions[1], please provide
the used WSDL document.
[1] <http://php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2017-07-25 03:33:36] peter_liang at vtech dot com
Please see if the solution in #74984 addresses this issue.
------------------------------------------------------------------------
[2013-06-18 14:47:20] koblavino at gmail dot com
Please, can somebody tell me in which PHP version we dont get this problem?
------------------------------------------------------------------------
[2012-11-21 18:28:02] seth at sethmatics dot com
Not sure what version of PHP your using, but my version of PHP is properly setting
the xsi:nil on NULL values. I found this bug while searching for issue with
"disappearing nodes when value is null".
------------------------------------------------------------------------
[2012-06-20 23:24:37] webmaster at guestwho dot com
Description:
------------
This is a duplicate of #41745 but that's been stuck on "No Feedback" since 2007, so I
thought I'd re-post.
When null is provided for a SOAP parameter or the field of an object passed as a SOAP parameter, PHP
incorrectly encodes the parameter as being empty (e.g. object with all null fields, or empty string)
which is different from an actual null. This breaks access to real-world web services.
Test script:
---------------
---------------
$soap = new SoapClient('/path/to/wsdl', array('trace' => true));
$soap->operation(null);
echo $soap->__getLastRequest();
Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="NAMESPACE"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:operation>
<paramName xsi:nil="true"/>
</ns1:operation>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Actual result:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="NAMESPACE">
<SOAP-ENV:Body>
<ns1:operation>
<paramName/>
</ns1:operation>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62378&edit=1