Flex WebService

WebService

1 客户端定义

 private function onResult(e:ResultEvent):void
   {
    result.text = e.result.toString();      //使用返回值
   }

<mx:WebService
  id="myService"
  wsdl="http://localhost:2368/FlashService.asmx?WSDL"    //提供web服务的wsdl地址
  result="onResult(event)"
  fault="onFault(event)"
  useProxy="false" >
  <mx:operation name="HelloWorld">    //webservice中定义的webmethod,name为方法名称
  <mx:request>
   <para>my client para</para>              //webmethod的参数
  </mx:request>
        </mx:operation>
 </mx:WebService>

2 服务器端提供服务

    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class FlashService : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld(string para)
        {
            return para + " Hello World";
        }
    }

3 WSDL介绍

http://hi.baidu.com/%B4%FA%BA%C58876/blog/item/0fa502ed6ba4024979f05541.html

 

 

AIR

 在操作xml文件过程中,发现用FileRefrence类无法实现本地保存,而在创建Flex Project时如果Application Type选择基于Desttop Application(runs in Adobe AIR),创建桌面程序,就可以进行本地化操作。但是在FB环境下运行程序正常,但是直接运行swf文件就会出现错误,不知道是什么原因。对于到底什么是AIR没有搞清楚,明天继续

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值