|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-21 21:47 UTC] johannes@php.net
[2007-06-29 01:00 UTC] php-bugs at lists dot php dot net
[2007-09-25 11:00 UTC] fredrik at wangel dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 10:00:01 2025 UTC |
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>