It took me a few hours to waste a group of waste resources on the Internet and finally found a solution.
1. Declare An as object in flash:
Code Package Com. xtar. biz. Constant. actionbody. Chat
{
[Remoteclass (alias = " Com. xtar. biz. Constant. actionbody. Chat. worldmessagebody " )]
Public Class Worldmessagebody Extends Object
{
Public VaR sendername: string;
Public VaR sendercode: string;
Public VaR body: string;
Public VaR createdate: date;
Public Function worldmessagebody ()
{
Return ;
}
}
}
2. declare the same object in Java
Code Package Com. xtar. biz. Constant. actionbody. Chat;
ImportJava. Io. serializable;
ImportJava. util. date;
Public Class Worldmessagebody Implements Serializable
{
Private Static Final Long Serialversionuid = 5297328693553539438l ;
Private String sendername;
Private String sendercode;
Private String body;
Private Date createdate;
PublicString getsendername ()
{
ReturnSendername;
}
Public VoidSetsendername (string sendername)
{
This. Sendername=Sendername;
}
PublicString getsendercode ()
{
ReturnSendercode;
}
Public VoidSetsendercode (string sendercode)
{
This. Sendercode=Sendercode;
}
PublicString getbody ()
{
ReturnBody;
}
Public VoidSetbody (string body)
{
This. Body=Body;
}
PublicDate getcreatedate ()
{
ReturnCreatedate;
}
Public VoidSetcreatedate (date createdate)
{
This. Createdate=Createdate;
}
}
3. Flash push objects:
Out. writeobject (msg. Body );
4. Java uses blazeds to receive objects:
Amf3input:Amf3in. readobject (); at this time, the read object is a Java object.
5. Java push objects:
Amf3output: amf3out. writeobject (pojo); press the object directly.