So… you’re seeing “NetConnection.Call.BadVersion” from Flash while attempting to talk to CPAMF or AMFPHP.
Well my friend, there’s a good probability that something is wrong.
Here are some suggestions:
- Fatal Error
- Redirect
What I tracked my problem down to was the fact that the following happens when AMFPHP receives a Flash remote object (using remoting):
- AMFPHP receives an AMF stream
- AMFPHP inteprets the stream byte by byte
- AMFPHP decides what sort of “thing” that Flash has attempted to send back
- AMFPHP attempts to “find” the relevant PHP class, defined by the class alias that has been sent in Flash.
e.g.Flash object is "com.org.my.namespace.path.MyClass"
and interprets that as com/org/my/namespace/path/MyClass.php (or MyClass.class.php) based on the base classMappingPath you sent in the service gateway,$gateway->setClassMappingsPath( '/absolute/path/to/vo/models' );
attempts to include it, and instantiate an object of MyClass (therefore your filename MUST match your class name).
i.e.$clazz = new $classname;
So I realised a problem. Constructors, both in Flash and PHP MUST at all costs have default values for them, i.e. the constructor variables are optional, because AMFPHP and Flash don’t use the sent objects, they literally convert them to their relevant objects on each side.
Further info on problems and debugging NetConnection.Call.BedVersion in Flash and AMFPHP can be found by google of course.