Zend_Soap_AutoDiscover自动生成wsdl
2011-08-07 09:38
260 查看
Zend_Soap_AutoDiscover虽然可以自动生成wsdl,可以通过标准注释,来生成一些wsdl属性。还提供了多种Strategy。但是这些还是无法自动生成复杂的wsdl或者不会使用。在网上,发现了一个zend framework推荐的,自动生成wsdl的Strategy。
连接:http://framework.zend.com/wiki/display/ZFPROP/Zend_Soap_Wsdl_Strategy_DefaultComplexType%2B-%2BImprovement%2Bfor%2Bthe%2BAutoDiscover%2B-%2BJeannie%2BBOFFEL
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.
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.
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.
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
?
可以将这个
连接:http://framework.zend.com/wiki/display/ZFPROP/Zend_Soap_Wsdl_Strategy_DefaultComplexType%2B-%2BImprovement%2Bfor%2Bthe%2BAutoDiscover%2B-%2BJeannie%2BBOFFEL
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
Zend Framework AutoDiscovery3. 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_Soap5. 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_DefaultComplexType8. 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.UC-01 |
---|
?
$details ->addBrotherDetail( new brotherDetail( "Jean" , 1, 10)); |
UC-02 |
---|
?
?
?
9. Class Skeletons
?DefaultComplexType类覆盖zend的library,不过这样貌似太粗暴,我是重新定义类名,放到个人类库里了。
相关文章推荐
- php中soap 的使用实例无需手写WSDL文件,提供自动生成WSDL文件类
- zend的soap是如何通过反射文档自动构建wsdl的
- php中soap 的使用实例无需手写WSDL文件,提供自动生成WSDL文件类
- php中soap 的使用实例和一些个人看法!亲测,无需手写WSDL文件,提供自动生成WSDL文件类
- php中soap 的使用实例和一些个人看法!亲测,无需手写WSDL文件,提供自动生成WSDL文件类(转)
- php中soap 的使用实例和一些个人看法!亲测,无需手写WSDL文件,提供自动生成WSDL文件类
- php中soap的使用实例以及生成WSDL文件,提供自动生成WSDL文件的类库——SoapDiscovery.class.php类
- php中soap的使用实例以及生成WSDL文件,提供自动生成WSDL文件的类库——SoapDiscovery.class.php类
- php中soap 的使用实例无需手写WSDL文件,提供自动生成WSDL文件类
- php学习之道:php中soap的使用实例以及生成WSDL文件,提供自动生成WSDL文件的类库——SoapDiscovery.class.php类
- php中soap 的使用实例和一些个人看法!亲测,无需手写WSDL文件,提供自动生成WSDL文件类
- PHP Soap续:zend studio 7 生成wsdl
- 【Webservice】 Eclipse根据wsdl文件自动生成webservice的调用客户端
- Webservice的wsdl文件解析与Soap消息的发送、接收(不生成java客户端代码)
- 自动生成 Makefile 的全过程详解! automake/autoconf 入门
- php zend studio 自动生成wsdl文件详解
- 根据wsdl生成客户端:Use of SOAP Encoding is not supported
- 自动生成 Makefile 的全过程详解! automake/autoconf 入门
- Android 之怎么删除eclipse自动生成的//TODO Auto-generated.
- Web Service学习笔记(webservice、soap、wsdl、jws详细分析) Webservice的wsdl文件解析与Soap消息的发送、接收(不生成java客户端代码)