I'm currently migrating a large project from Flex 3 to Flex 4.5. The problem I'm stuck on is network communication: we're using a custom protocol that we embed in AMF3, but it seems the messages sent by flash.net.NetConnection aren't readable.
Our Java back-end uses some BlazeDS classes to deserialize the message, namely flex.messaging.io.amf.AmfMessageDeserializer.AmfMessageDeserializer, and I can monitor the network traffic with Charles Web Proxy which decodes AMF3. The very simple code herebelow sends a message that can be decoded by Charles when compiled in Flex 3.5, but not in Flex 4.5 (I get "Failed to parse data (com.xk72.amf.AMFException: Unsupported AMF3 packet type 17 at 26").
import mx.controls.Alert;
private function init():void
{
var pdl : Dictionary = new Dictionary();
var connection : NetConnection = new NetConnection();
connection.connect("http://localhost");
var responder : Responder = new Responder(result);
connection.call("net", responder, pdl);
}
private function result(pdl : Object) : void {
Alert.show("coucou", "hello");
}
I've set up an apache server at localhost:80 to test this.
Has anyone used NetConnection in Flex 4.5 and encountered deserialization problems? How did you solve them?
Thanks,
Daniel