Zend Framework 101: Zend_Soap
As stated previously, this is a somewhat simplified implementation of web services. There are several things you can add to make this a more advanced implementation. These may include:
- Complex data types, such as arrays and objects.
- Type mapping (automatically mapping SOAP data types to local PHP classes on both the server and client). This allows easier manipulation of data passed to and returned from web service calls.
- Authentication. There are two levels of authentication: one to protect who can access the web service directly, and the second is to let users authenticate via a web service so they receive an elevated level of access.
- Error handling. We can't always assume data passed to web service calls is valid. The server needs the ability to send errors, and clients need to be able to detect errors and handle them accordingly.
- Caching. Since every call to a web service can potentially be quite expensive (in terms of time and processing power), it can be extremely beneficial to implement a caching mechanism that allows you re-use the response from web service calls without having to communicate with the SOAP server.
- WSDL file caching. In this article I haven't covered anything to do with caching of WSDL files. By default, the server and client will cache these files, but you can control this behaviour when instantiating
Hopefully in an upcoming article I will cover each of these aspects.