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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 - 5 = ?
Subscribe to this entry?

 
 [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-2023 The PHP Group
All rights reserved.
Last updated: Sat Jun 03 22:03:41 2023 UTC