Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Bug #20343 Warning caused by not being able to define defaults for parameters
Submitted: 2014-07-09 13:40 UTC
From: codepunker Assigned:
Status: Open Package: SOAP (version 0.13.0)
PHP Version: 5.5.9 OS: Ubuntu 14.04
Roadmaps: (Not assigned)    
Subscription  


 [2014-07-09 13:40 UTC] codepunker (Daniel Gheorghe)
Description: ------------ I have tried to create a WSDL server using this package and I found the following issue: When defining a "__dispatch_map" with one or multiple in parameters in the server, if the client calls the respective method with less parameters, the eval in WSDL.php (line: 798) throws a warning. I have come to the conclusion that this is caused by the "creation" of the eval'd class which doesn't have a way of defining defaults for the method parameters. I have "pacthed" the WSDL.php file - line: 516 as follows: from: $args .= '$' . $argname; to: $args .= '$' . $argname . '=null'; The above is just a hack of course. P.S. The client(test script) below uses your example disco Server: http://pear.php.net/reference/SOAP- latest/__filesource/fsource_SOAP__SOAP- 0.13.0exampledisco_server.php.html Test script: --------------- ini_set("display_errors", "on"); ini_set("soap.wsdl_cache_enabled", 0); require_once "SOAP/Client.php"; $sw = new SOAP_WSDL ("http://example.com/?wsdl"); $proxy = $sw->getProxy(); $erg = $proxy->SayHallo (); //this method expects one parameter, but if the client doesn't specify it, the warning is thrown echo $erg."\n"; Expected result: ---------------- Warning: Missing argument 1 for WebService_MP3DBService_MP3DBPort::SayHallo(), called in /PATH/client.php on line 16 and defined in /usr/share/php/SOAP/WSDL.php(798) : eval()'d code on line 7 Actual result: -------------- Nothing to add.

Comments