Zend Framework

Zend_Soap_AutoDiscover: If missing the @return in your docblock the message response in the WSDL is not generated.

Details

  • Type: Docs: Task Docs: Task
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Labels:
    None

Description

Zend_Soap_AutoDiscover: If missing the @return in your docblock the message response in the WSDL is not generated.

/**

  • Retrieves all informatin for the specified user
    *
  • @param string $uid, the user for whom information whould be retrieved
  • @param int $vid
    */
    public function userGet( $uid, $vid ) { return $this->Users->get($uid, $vid); }

Error in WSDL:

<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>WSDL</faultcode>
<faultstring>SOAP-ERROR: Parsing WSDL: Missing <message> with name 'tns:userGetResponse'</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Issue Links

Activity

Hide
Andrew Johnstone added a comment -

Was editing a doctype at the type at the time of writing and meant to state docblock.

Show
Andrew Johnstone added a comment - Was editing a doctype at the type at the time of writing and meant to state docblock.
Hide
Wil Sinclair added a comment -

Please evaluate and categorize as necessary.

Show
Wil Sinclair added a comment - Please evaluate and categorize as necessary.
Hide
Matthew Weier O'Phinney added a comment -

Each of the server components – and WSDL autodiscovery falls in this category – utilizes the PHP docblocks provided by the developer to determine the parameter and return types. In fact, for scalar types, this is the only way to determine the parameter types, and for return types, this is the only way, period, to determine them.

If you are not providing them, we cannot build the WSDL accurately, as the types are unknown; this would lead to breakage in the clients connecting to the service. Additionally, it's an issue of best practices; you should be giving complete API documentation for each method, which would include documenting each parameter and the return value.

Show
Matthew Weier O'Phinney added a comment - Each of the server components – and WSDL autodiscovery falls in this category – utilizes the PHP docblocks provided by the developer to determine the parameter and return types. In fact, for scalar types, this is the only way to determine the parameter types, and for return types, this is the only way, period, to determine them. If you are not providing them, we cannot build the WSDL accurately, as the types are unknown; this would lead to breakage in the clients connecting to the service. Additionally, it's an issue of best practices; you should be giving complete API documentation for each method, which would include documenting each parameter and the return value.
Hide
Alexander Veremyev added a comment -

Type changed from 'Bug' to 'Docs: Task' (the behavior should be described in the documentation)

Show
Alexander Veremyev added a comment - Type changed from 'Bug' to 'Docs: Task' (the behavior should be described in the documentation)
Hide
Alexander Veremyev added a comment -

Done.

Show
Alexander Veremyev added a comment - Done.
Hide
exceptione added a comment -

@matthew: you can't do, because phpdoc requires this:

@return type description This tag should not be used for constructors or methods defined with a void return type.

{/quote}

http://en.wikipedia.org/wiki/PHPDoc

If there is no @return-comment, you can safely assume that the method has no return value. (That is not the same as one-way communication though)
See also: http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.return.pkg.html

Very important!

Show
exceptione added a comment - @matthew: you can't do, because phpdoc requires this:
@return type description This tag should not be used for constructors or methods defined with a void return type. {/quote} http://en.wikipedia.org/wiki/PHPDoc If there is no @return-comment, you can safely assume that the method has no return value. (That is not the same as one-way communication though) See also: http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.return.pkg.html Very important!

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: