1 Reply Latest reply on Apr 10, 2014 12:12 AM by Spacorum

    Max nested levels reached on object sent with RemoteObject

    Spacorum

      Hello:

       

      We have an application that uses RemoteObject connections (with AMFPHP) to send an custom class object to PHP. This object has multiple depth levels, with nested objects inside the main one. We noticed that once a particular level is reached, the RemoteObject serialization crashes throwing this error:

       

      TypeError: Error #1034: Type Coercion failed: cannot convert Object@7e30f89 en mx.messaging.messages.IMessage.

       

       

      We tried to send a lighter object, with no properties, just the nested levels. The same occurs. In example:

       

      var params:Object = {};
      params['test'] = {0:{1:{2:{3:{4:{5:{6:{7:{8:{9:{10:{11:{12:{13:{14:{15:{16:{17:{18:{19:{20:{21:{22:{}}}}}}}}}}}}}}}}}}}}}}}};
      remoteObject.runService(params);
      

       

       

      If the object has less levels, it works:

       

      params['test'] = {0:{1:{2:{3:{4:{5:{6:{7:{8:{9:{10:{11:{12:{13:{14:{15:{16:{17:{18:{19:{20:{21:{}}}}}}}}}}}}}}}}}}}}}}};
      

       

      So it seems that the RemoteObject has a depth limit of 24 levels? Maybe 23, I´m not sure. Sending in JSON is not an option, as I lose all the typed classes and objects inside the main object.

       

      Can anyone provide a good approach to face this problem??

      Thanks in advance!