#41745 [Opn->Fbk]: PHP incorrectly encodes null values in SOAP
| From: | johannes@php.net | Date: | Thu, 21 Jun 2007 21:47:51 +0000 |
| Subject: | #41745 [Opn->Fbk]: PHP incorrectly encodes null values in SOAP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114044@lists.php.net to get a copy of this message | ||
ID: 41745
Updated by: johannes@php.net
Reported By: jasper at digiweb dot co dot nz
-Status: Open
+Status: Feedback
Bug Type: SOAP related
Operating System: Linux
PHP Version: 5.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2007-06-20 02:40:17] jasper at digiweb dot co dot nz
Description:
------------
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.
Reproduce code:
---------------
$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>
== OR ==
<?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/>
</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 http://bugs.php.net/?id=41745&edit=1