ZF-4125: Zend_Soap_Autodiscover/Zend_Soap_Wsdl replicates request messages for methods with multiple return types

Issue Type: Bug Created: 2008-08-29T17:02:57.000+0000 Last Updated: 2008-11-13T14:10:28.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Matthew Turland (elazar) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_Soap_Server

  • Zend_Soap_Wsdl

Related issues: - ZF-4688



As of SVN rev 11146, when Zend_Soap_Autodiscover::setClass() is called and passed the name of a class with the following method declaration..,

<pre class="literal">
* @param string $id
* @return array|null Column-value pairs or NULL if the record is not
*         found
public function retrieve($id)
    return $row ? $row : null;

... the resulting WSDL contains multiple identical retrieveRequest messages, one for each potential return type...

<pre class="highlight">

The reason for this appears to be that neither Zend_Soap_Autodisover::setClass() nor Zend_Soap_Wsdl::addMessage() check to ensure that a message being added isn't identical to one that was previously added. Pointing Zend_Soap_Client_Local to this WSDL results in this error: "SoapFault: SOAP-ERROR: Parsing WSDL: 'retrieveRequest' already defined."


Posted by Benjamin Eberlei (beberlei) on 2008-10-26T12:04:06.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:28.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.