ZF-4688: Invalid WSDL when more then one prototype is given for any reflected function

Issue Type: Bug Created: 2008-10-23T05:54:53.000+0000 Last Updated: 2008-11-13T14:10:16.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Benjamin Eberlei (beberlei) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_Soap_Wsdl

Related issues: - ZF-4125



Zend_Soap_Wsdl generates an invalid WSDL document when used with Zend_Soap_AutoDiscover and a class or function that has more than one prototype for a call. That means, if any variable has a default value in a method/function definition like "function foo($a=1) { }" it produces two request and response messages which is invalid WSDL. I am no wsdl guru at all but php SOAPServer dies with a fatal error saying "multiple response (request) messages with the same name".



require_once "Zend/Loader.php"; Zend_Loader::registerAutoload();

class MyMultiplyService { /** * Hello multiply * * @param int $a * @param int $b * @return int / public function multiply($a=1, $b=1) { return $a$b; } }

$autodiscover = new Zend_Soap_AutoDiscover(); $autodiscover->setClass('MyMultiplyService'); $autodiscover->handle(); {/quote}

Consume the generated WSDL with:

{quote}$server = new SOAPServer('uri/to/wsdl');{/quote}


Posted by Benjamin Eberlei (beberlei) on 2008-10-26T12:04:23.000+0000

Fixed in trunk, with the following important note:

Each method has one or more prototypes depending on the given parameter types or default values of the variables. In the status pre Revision 12132 the AutoDiscover would built operations for each of this prototypes which is invalid behaviour. SOAP can only handle one prototype per function except when they are renamed and forwarded. This cannot be depicted by AutoDiscover since it would lead to operations called xyz1(), xyz2() and so forth.

What AutoDiscover now does is the following: It searches for the prototypes with the largest number of parameters for each class method and uses this one for WSDL Generation. If multiple prototypes are found with the largest parameter number the first one will be picked.

Posted by Wil Sinclair (wil) on 2008-11-13T14:10:16.000+0000

Changing issues in preparation for the 1.7.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.