WSDL caching
While developing a webservice application do not forget to disable WSDL caching, e.g. in your php.ini configuration file.soap.wsdl_cache_enabled=0
Set path to SOAP server in WSDL file
When you use a controller for your webservice and desire to have two actions, one for the automatically generated WSDL file and one for the server, use the setUri method of the Zend_Soap_AutoDiscover class to set the URI of the server.$wsdl->setUri('http://example.localhost/index/soapserver');
Error handling
Error handling with exceptions is easy. I suggest to create your own Exception class first, it can be empty for now:In your webservice class throw your new exception on invalid input for example.
On SOAP server side, you have to register your Exception class:
On Soap client side embed your request in a try - catch block:
Which for example outputs: 'SOAP ERROR: [Receiver] The product ID does not exist!'
The code
The webservice controller:The webservice class:
The custom Exception class: