php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52319 SOAPServer does not use default argument values
Submitted: 2010-07-12 17:24 UTC Modified: 2010-07-12 17:26 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: mmalone at nutshell dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.2 OS: Mac OS 10.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-07-12 17:24 UTC] mmalone at nutshell dot com
Description:
------------
When calling a SOAP function or method in WSDL mode that has optional arguments, the default value for those arguments will be ignored if the SOAP request does not specify those parameters or sets them to nil. Instead, the function will receive NULL for all such parameters.

Test script:
---------------
Here is a fully self-contained test script: http://pastebin.com/szEye5nv

The script writes the WSDL file to the system's temporary directory.

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:exampleFunctionResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:string">param1 = 'SET', param2 = NULL, param3 = NULL, param4 = NULL</return></ns1:exampleFunctionResponse></env:Body></env:Envelope>

Actual result:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:exampleFunctionResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="xsd:string">param1 = 'SET', param2 = 'foo', param3 = 'bar', param4 = 'baz'</return></ns1:exampleFunctionResponse></env:Body></env:Envelope>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-12 17:26 UTC] mmalone at nutshell dot com
I just realized I accidentally switched the "Expected result" and "Actual result" in the report. The expected result is the one returning "param1 = 'SET', param2 = 'foo', param3 = 'bar', param4 = 'baz'"
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue May 26 06:01:25 2020 UTC