NetConnection.Call.Failed: Undefined offset: 0 - as3 AMF problem sending class instance.

Submitted by admin on Mon, 05/08/2023 - 10:20

It took me hours to solve the problem with continuous "NetConnection.Call.Failed" on Flash/Flex, server side AMF3 parser keeps receiving empty data array... Showing notices at watchdog: Notice: Undefined offset: 0 in Zend_Amf_Request->readBody() (line 186 of .\sites\all\libraries\Zend\Amf\Request.php). and various Zend_Amf_Exceptions... Want to know how to solve it?

You just need to undederstood - AMF3 can't send DYNAMIC classes (or Zend AMF reader can't parse them), I've already forgot that I've added 'dynamic' to my class definition and spend hour of time removing properties and functions from my class to get it working when I've noticeds that word in the top of source file %)

The error codes was folowing:

  • Notice: Undefined offset: 0 in Zend_Amf_Request->readBody() (line 187 of .\sites\all\libraries\Zend\Amf\Request.php).
  • Zend_Amf_Exception: Unable to parse ...... body data Buffer underrun at needle position: 112 while requesting length: 54 in Zend_Amf_Request->readBody() (line 176 of .\sites\all\libraries\Zend\Amf\Request.php).
  • Zend_Amf_Exception: Unable to parse ...... body data Unsupported type marker: 15 in Zend_Amf_Request->readBody() (line 176 of .\sites\all\libraries\Zend\Amf\Request.php).
  • Zend_Amf_Exception: Unable to parse tps.transaction_add body data Undefined string reference: 50 in Zend_Amf_Request->readBody() (line 176 of .\sites\all\libraries\Zend\Amf\Request.php).
  • Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in Zend_Amf_Parse_Amf3_Deserializer->readXmlString() (line 421 of .\sites\all\libraries\Zend\Amf\Parse\Amf3\Deserializer.php).