We are working on a PHP project using Zend's remoting capabilities (Zend_Amf_Server). In the flex client application we connect to the server using the RemoteObject class.
There are the two events (ResultEvent and FaultEvent) for us to listen for. As we have figured out we are able to trigger fault events by throwing exceptions. Are there other ways to indicate failure for example if data validation does not pass certain checks.
We have tried to return objects of Zend_Amf_Value_Messaging_ErrorMessage from the service methods but this won't work and the result handler instead of the fault handler is still called.
Throwing exceptions to indicate errors is a way we can adapt to. The problem here is that we are not able to give custom data to the outside. However there is an $extendedData property in the Zend_Amf_Value_Messaging_ErrorMessage class. Since there is no way yet to get data into it seems we need to apply some monkey patches to the Zend Framework. I think we introduce a new interface IErrorInfoException with a method called getExtendedData().