开发者

AMF3 decoder in Flex?

How can i decode AMF3 Object in Flex. We have a python Socket server which encodes data as AMF3.

We already deserialize data in Android Client but cant find a good way to do that in Flex.

Edit.

Take a look how we are doing Java for Android client.

String res = res.substring(1);
InputStream in = new ByteArrayInputStream(res.getBytes()); 
DataInputStream dis = new DataInputStream(in);
AMF3Deserializer amf = new AMF3Deserializer(dis);
Object o = null;

try { 
    o = amf.readObject(); 
} catch (IOException e) {
    e.printStackTrace(); 
} 

Map map = (HashMap)o;

Object[] ob = (Object[]) map.get("result_set"); 
Object[] 开发者_如何学Goobn = (Object[]) ob[0];


ByteArray.readObject() will decode AMF.


incase there are new searchers for this topic, in AS3, use flash.net.Socket.readObject() method. It will automaticaly read the object as AMF format


You can use RemoteObject to connect to a AMF service.

Read here for more info.


Why wouldn't you use a RemoteObject to make your calls to the server? Then deserialization is handled automatically for you.

Did you write your own AMF serialization / deserialization methods on the server? Or did you use something like PythonAMF?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜