Bug #52319 [Opn]: SOAPServer does not use default argument values
| From: | mmalone at nutshell dot com | Date: | Mon, 12 Jul 2010 15:26:19 +0000 |
| Subject: | Bug #52319 [Opn]: SOAPServer does not use default argument values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152316@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52319&edit=1
ID: 52319
User updated by: mmalone at nutshell dot com
Reported by: mmalone at nutshell dot com
Summary: SOAPServer does not use default argument values
Status: Open
Type: Bug
Package: SOAP related
Operating System: Mac OS 10.4
PHP Version: 5.3.2
New Comment:
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'"
Previous Comments:
------------------------------------------------------------------------
[2010-07-12 17:24:06] 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>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52319&edit=1