Details
Description
Trying to send an ArrayCollection from flex to ZendAMF leads to following error:
<br />
<b>Fatal error</b>: Uncaught exception 'Zend_Amf_Exception' with message 'Unable to parse null body data flex.messaging.io.ArrayCollection mapped class is not defined' in C:\wamp\www\ZendFramework\library\Zend\Amf\Request.php:174
Stack trace:
#0 C:\wamp\www\ZendFramework\library\Zend\Amf\Request.php(125): Zend_Amf_Request->readBody()
#1 C:\wamp\www\ZendFramework\library\Zend\Amf\Request.php(93): Zend_Amf_Request->readMessage(Object(Zend_Amf_Parse_InputStream))
#2 C:\wamp\www\ZendFramework\library\Zend\Amf\Request\Http.php(64): Zend_Amf_Request->initialize('??????null/...')
#3 C:\wamp\www\ZendFramework\library\Zend\Amf\Server.php(432): Zend_Amf_Request_Http->__construct()
#4 C:\wamp\www\ZendFramework\library\Zend\Amf\Server.php(374): Zend_Amf_Server->getRequest()
#5 C:\wamp\www\TestZend1-debug\gateway.php(50): Zend_Amf_Server->handle()
#6 {main}
thrown in <b>C:\wamp\www\ZendFramework\library\Zend\Amf\Request.php</b> on line <b>174</b><br />
Sample code to do this can be:
<RemoteObject id="srv" endpoint="http://localhost/TestZend1-debug/gateway.php" destination="createItem" source="Test" result="remoteobject1_resultHandler(event)" fault="srv_faultHandler(event)"/>
protected function fxapplication1_creationCompleteHandler(event:FlexEvent):void
{
var a:ArrayCollection = new ArrayCollection();
a.addItem('hello');
a.addItem('world');
srv.createItem(a);
}
ArrayCollections should be supported as it is widely used in flex.
Fixed - ArrayCollection now is converted to array.