Zend_Soap is intended as a convenience layer over PHP's SoapServer class. It will allow aggregating configuration options for the SoapServer constructor, error handling, and inspection of requests and responses.
3. Component Requirements, Constraints, and Acceptance Criteria
This component will allow setting SoapServer options individually, en masse, or via the constructor
This component will allow inspecting the request and response handled
This component will catch errors and exceptions and report them as SOAP faults
4. Dependencies on Other Framework Components
SoapServer
Zend
5. Theory of Operation
Zend_Soap_Server will operate, at its most basic level, exactly like the PHP SoapServer. The key differences are the addition of:
Ability to set configuration options individually
Request and response introspection
Mimics SoapClient: getLastRequest() and getLastResponse() methods
Error/exception handling to explicitly throw as SOAP faults
Turns display_errors off
Traps exceptions from SoapServer::handle() and re-throws them as SoapFaults
Registers an internal method as an error handler for E_USER_FATALs, and throws trapped PHP errors as exceptions
Has a whitelist approach to exceptions; only registered exception classes may be returned as SoapFaults; all others result in a SoapFault with an 'unknown error' message
6. Milestones / Tasks
Milestone 1: Initial proposal
Milestone 2: Code samples and use cases in proposal
Milestone 3: Proposal acceptance
Milestone 4: Working prototype checked into the incubator supporting use cases (with unit tests)
<ul>
<li>easier object setup (no need to pass in all options at once to the constructor)</li>
<li>ability to pass in non-HTTP request strings</li>
<li>built in introspection of request and response</li>
<li>ability to capture response prior to returning it, allowing response manipulation</li>
<li>better error handling
<ul>
<li>including the ability to specify which exception classes are allowed to generate fault messages</li>
<li>ability to capture E_USER_ERROR and return as a soap fault</li>
</ul>
</li>
</ul>
<ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Comments</ac:parameter><ac:rich-text-body>
<p>The proposal is approved for incubator development, provided that the following issues are addressed:</p>
<ul>
<li>The setOptions() method could strtolower($key) for option name case insensitivity.</li>
<li>Protected methods should appear below public-facing methods.</li>
<li>Clearly document actor and URI (URN) options.</li>
</ul>
</ac:rich-text-body></ac:macro>
<p>How about to to some progress in this component?</p>
<p>I've found, that WSDL, generated by Zend_Soap_Autodiscover isn't compatible with Adobe Flex, for example. Web service client, based on Flex mx.rpc.WebService component generates empty body tag in SOAP request.</p>
<p>Class Zend_Soap_Autodiscover has not very good interface, I think it must not extend Zend_Server_Abstract.</p>
4 Comments
comments.show.hideFeb 22, 2007
Matthew Ratzloff
<p>What are the benefits of using this class over SoapServer itself?</p>
Feb 22, 2007
Matthew Weier O'Phinney
<p>The primary benefits are:</p>
<ul>
<li>easier object setup (no need to pass in all options at once to the constructor)</li>
<li>ability to pass in non-HTTP request strings</li>
<li>built in introspection of request and response</li>
<li>ability to capture response prior to returning it, allowing response manipulation</li>
<li>better error handling
<ul>
<li>including the ability to specify which exception classes are allowed to generate fault messages</li>
<li>ability to capture E_USER_ERROR and return as a soap fault</li>
</ul>
</li>
</ul>
<p>Hope that answers your questions!</p>
Mar 02, 2007
Darby Felton
<ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Comments</ac:parameter><ac:rich-text-body>
<p>The proposal is approved for incubator development, provided that the following issues are addressed:</p>
<ul>
<li>The setOptions() method could strtolower($key) for option name case insensitivity.</li>
<li>Protected methods should appear below public-facing methods.</li>
<li>Clearly document actor and URI (URN) options.</li>
</ul>
</ac:rich-text-body></ac:macro>
Jul 12, 2007
Sergey Belov
<p>How about to to some progress in this component?</p>
<p>I've found, that WSDL, generated by Zend_Soap_Autodiscover isn't compatible with Adobe Flex, for example. Web service client, based on Flex mx.rpc.WebService component generates empty body tag in SOAP request.</p>
<p>Class Zend_Soap_Autodiscover has not very good interface, I think it must not extend Zend_Server_Abstract.</p>