ÒÔÇ°Ò»Ö±Óà HttpServices Á¬½Ó. ºóÀ´·¢À´ÓеÄÏîÄ¿ÓõÄÊÇremoteObject Á¬½Ó,Óе㿴²»¶®,Ëù
ÒÔÓÃËüÏȲâÊÔÒ»ÏÂ.²»¹ýÄØ.·þÎñÆ÷²¿·Ö²»ÖªµÀÔõôдÁË£¿
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
private function say():void {
var user:User = new User() ;
user.setId(1) ;
user.setName("hello") ;
sayRemote.SayHello(user) ;
}
private function SayRem(event:ResultEvent):void {
target.text = event.result as String ;
}
]]>
</mx:Script>
<mx:RemoteObject id="sayRemote">
<mx:method name="SayHello" result="SayRem(event)" />
</mx:RemoteObject>
<mx:TextInput id="n" change="say()"/>
<mx:Label text="target" id="target" />
</mx:Application>
package
{
[RemoteClass(alias="User")]
public class User
{
public var name:String ;
public var id:int ;
public function User()
{
}
ͨ¹ýjava³ÌÐò£¬ÏȱàÒëc³ÌÐò£¬Èç³öÏÖ´íÎó£¬ÌáʾC³ÌÐòÖеĴíÎ󣬱àÒë³É¹¦¾ÍÔËÐУ¬ÏÔʾCµÄÔËÐнá¹û£¬×îºÃ°ÑCµÄÔËÐÐʱ¼äºÍÄÚ´æµÈ¶¼ÏÔʾ³öÀ´
¸÷λ´ó¸ç´ó½ã°ï°ï棬СµÜ¸Ð¼¤²»¾¡£¡
ÓÃjavaµÄ½ø³ÌÀàÊÔÊÔ
ÎÒ¸øÄãת ......
×Ö·ûÁ÷µÄ¶ÁºÍд×îÖÕÔڵײ㶼ÊÇͨ¹ý×Ö½ÚÁ÷À´Íê³ÉµÄÂ𣿡¡¶ÁдÎı¾Îļþ×Ö·ûÁ÷Ó¦¸Ã¾Í¿ÉÒÔÁË°É¡£¡£
¸÷λ´ó¸ç´ó½ã°ï°ïæ°¢
JavaÁ÷°üÀ¨×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷£¬×Ö½ÚÁ÷ͨ¹ýIOÉ豸ÒÔ×Ö½ÚÊý¾ÝµÄ·½Ê½¶ÁÈ룬¶ø×Ö·ûÁ÷ÔòÊÇͨ¹ý×Ö½ÚÁ÷ ......