#41745 [NEW]: PHP incorrectly encodes null values in SOAP
| From: | jasper at digiweb dot co dot nz | Date: | Wed, 20 Jun 2007 02:40:17 +0000 |
| Subject: | #41745 [NEW]: PHP incorrectly encodes null values in SOAP | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-113948@lists.php.net to get a copy of this message | ||
From: jasper at digiweb dot co dot nz
Operating system: Linux
PHP version: 5.2.3
PHP Bug Type: SOAP related
Bug description: PHP incorrectly encodes null values in SOAP
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 bug report at http://bugs.php.net/?id=41745&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41745&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41745&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41745&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41745&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41745&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41745&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41745&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41745&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41745&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41745&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41745&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41745&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41745&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41745&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41745&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41745&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41745&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41745&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41745&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41745&r=mysqlcfg