Issues

ZF-9180: Zend Soap Autodiscovery doesn't generate enumerations and minOccurs or maxOccurs

Description

Original request : {quote} This lib utilizes the PHP docblocks provided by the developer to determine the parameter and return types. We could also add enumerations or minOccurs and maxOccurs. It could be like this :


/**
* @var string maxOccurs=1 minOccurs=1 enumerate={'toto','titi','tutu'}
*/

{quote}

New possible design:


/**
 * @xsd simpleType
 * @xsd restriction array('base' => 'xsd:string')
 */
class allowedWordsType
{
    /**
     * @xsd enumeration array('value' => 'toto')
     * @xsd enumeration array('value' => 'titi')
     * @xsd enumeration array('value' => 'tutu')
     */
    public $enumeration;
}

...

/**
* @var allowedWordsType array('maxOccurs'=>1, 'minOccurs'=>1)
*/

Comments

For this we would need a real parser for docblocks, i don't think this is a good idea or a viable task anytime soon.

The generated WSDL files are not meant to be perfect, in many cases you can use them as a first template and then optimize it for your needs.

If the generated WSDL isn't meant to be perfect, why have it at all. It becomes a half ass solution that doesn't help you when you need it; tools that don't help you aren't tools at all.

Hi, I agree that, with the given example, parsing with docblocks could be a pain with current support. But I thought about another design with more simple docblocks and using model of support of complexType to adapt also to simpleType.

I sent my proposal here : Zend_Soap_Wsdl_Strategy_DefaultComplexType - Improvement for the AutoDiscover

It's not breaking existing code and use tag @xsd for any XSD details to generate them in style part of the WSDL document.

I think, this feature is really needed for any professional webservice, it is often requested to describe with details the return format and give a XSD to validate soap request and response.

It could replace the current component Zend_Soap_Wsdl_Strategy_DefaultComplexType.

For test it is also possible to use it with setComplexTypeStrategy of Zend_Soap_AutoDiscover.