From:             webmaster at guestwho dot com
Operating system: FreeBSD 8.3-RELEASE
PHP version:      5.3.14
Package:          SOAP related
Bug Type:         Bug
Bug description:PHP incorrectly encodes null values in SOAP

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 bug report at https://bugs.php.net/bug.php?id=62378&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=62378&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=62378&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=62378&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=62378&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62378&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=62378&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=62378&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=62378&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=62378&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=62378&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=62378&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=62378&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=62378&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=62378&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=62378&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62378&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=62378&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=62378&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=62378&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=62378&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=62378&r=mysqlcfg

Reply via email to