Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Soap_Wsdl_Strategy_DefaultComplexType Component Proposal

Proposed Component Name Zend_Soap_Wsdl_Strategy_DefaultComplexType
Developer Notes
Proposers Jeannie BOFFEL
Zend Liaison TBD
Revision 1.0 - 11 November 2010: Initial Draft. (wiki revision: 30)

Table of Contents

1. Overview

Improvement of Zend_Soap_Wsdl_Strategy_DefaultComplexType goal is to give a real possibility to describe XSD for auto-generated WSDL via PHP Document in commentaries without breaking existing code using current version.

The goal is not to give a full support of XSD technology. But at least, we could try to make possible usage of 80% or 90% of basic component of XSD. Most used one. I think this goal is reach with current version.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will add support for describing XSD of auto-generated WSDL through the use of the AutoDiscovery.
  • This component will replace existing Zend_Soap_Wsdl_Strategy_DefaultComplexType component.
  • This component will generate same XSD+WSDL than previous component if new features are not used (not breaking code).
  • This component will reserve php Doc tag @xsd for any action linked to new features.
  • This component will not validate the XSD generated. Meanning we don't prevent user from doing wrong XSD by adding unexisting attribute to an element for example.
  • This component will not be exhaustive and will not support all XSD features immediately.

4. Dependencies on Other Framework Components

  • Zend_Soap

5. Theory of Operation

The component is instantiated by AutoDiscovery system of Zend Framework when trying to auto-generate a WSDL+XSD via reflection on the code.

6. Milestones / Tasks

  • Feature Request 1: I tried to add support for use ref attributes in element tag,
    but the generated soap response with soap server is not compatible for now.
    WSDL+XSD are correct, but response will not match the auto-generated XSD...
    So use only complexType with call to them with style attribute.
  • Feature Request 2: Add support for SOA design, meaning improve again AutoDiscovery, improve also Zend_Soap_Wsdl which has a bug in its way to genrate the XML, improve Zend_Soap_Server because register exception system is not really usable as is with idea of SOA design for example. However, it's also possible to decide to not use this support for now.
    I implemented already almost everything needed, except error handler, not yet sure about the design.
  • Milestone #: [DONE] Design
  • Milestone #: [DONE] Proof of concept by implement new complex type strategy
  • Milestone #: [DONE] Start support of based most use tag of XSD, such as sequence, choice, all
  • Milestone #: [DONE] Start support of basical restriction such as minOccurs, maxOccurs
  • Milestone #: [DONE] Start support of simpleType through new class, like for complexType
  • Milestone #: [DONE] Start support of more complex restriction type such as pattern, enumeration through simpleType support
  • Milestone #: [DONE] Start support of union and list through simpleType support
  • Milestone 1: Working prototype checked into the incubator supporting use cases #1.
  • Milestone 2: Unit tests exist, work, and are checked into SVN.
  • Milestone 3: Initial documentation exists.

7. Class Index

  • Zend_Soap_Wsdl_Strategy_DefaultComplexType

8. Use Cases

To test validation of schema against xml response from a PHP SoapServer, for example with SoapUI, please generate in literal mode. Do not try to generate in document style instead of RPC.


Basic exemple with 2 simpleType, 3 complexType, 1 function


Example of union of simpleType :

Generated WSDL+XSD for Use Case 1

Generated part of XSD for Use Case 2

9. Class Skeletons



soap soap Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jan 23, 2013

    <ac:macro ac:name="unmigrated-wiki-markup"><ac:plain-text-body><![CDATA[Why to me that script don't work?

    When I use the DefaultComplexType standard I have:
    When I write "@xsd" in class I don't read nothing into wsdl, that is the field into class don't write into wsdl.

    And more, I tried the simplexType:


    • @xsd simpleType
    • @xsd restriction array('base' => 'xsd:string')
      class FilterTypeString
    • @xsd enumeration array('value' => 'test1')
    • @xsd enumeration array('value' => 'test2')
    • @xsd enumeration array('value' => 'test3')
      public $enumeration;

    then in wsdl I read:

    -<xsd:complexType name="FilterTypeString"><xsd:all/>


    When I replace the file DefaultComplexType with yours I read an error:

    Notice: Undefined offset: 0 in C:\wamp\www\Zend\Soap\Wsdl\Strategy\DefaultComplexType.php on line <i>69</i
    1 0.0009 384864

    Unknown macro: {main}

    ( ) ..\index.php:0
    2 0.0087 670376 Zend_Soap_AutoDiscover->addFunction( ) ..\index.php:41
    3 0.0238 1854664 Zend_Soap_AutoDiscover->_addFunctionToWsdl( ) ..\AutoDiscover.php:373
    4 0.0238 1854872 Zend_Soap_Wsdl->getType( ) ..\AutoDiscover.php:432
    5 0.0238 1854920 Zend_Soap_Wsdl->addComplexType( ) ..\Wsdl.php:582
    6 0.0239 1854920 Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex->addComplexType( ) ..\Wsdl.php:619
    7 0.0239 1855176 Zend_Soap_Wsdl_Strategy_DefaultComplexType->addComplexType( ) ..\ArrayOfTypeComplex.php:83

    Parse error: syntax error, unexpected '=' in C:\wamp\www\Zend\Soap\Wsdl\Strategy\DefaultComplexType.php(196) : eval()'d code on line 1

    thanks a lot]]></ac:plain-text-body></ac:macro>