qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

Asp.net与Flex交互测试记录

  一、利用asp.net为Flex提供数据服务,flex为前端表现。
  二、flex通过三种方式四种代码实现来取数据。分别为
  HttpService、
  WebService、
  RemoteObject、
  RemoteObjectAMF0。
  三、Project文件夹中的
  Vs2010Service提供HttpService、Webservice服务;
  Vs2008RemoteObject提供RemoteObject服务。
  四、FluorineFx.NET+RemoteObjectAMF0文件为附加文件。
  五、<sessionState cookieless="AutoDetect"></sessionState>
  设置可兼容客户端禁用Cookie(要在Flex项目中传递回sessionid)
  六、asmx中使用session需要[WebMethod(EnableSession = true)] 如此设置。
  七、安装FluorineFx.NET+RemoteObjectAMF0文件下的setup(FluorineFx.NET).exe
  可以将项目模板集成到2005和2008中,不支持vs2010。
  八、使用七中的模板建立普通网站(FluorineFx ASP.NET Web Site)项目。
  将Console.aspx设为启动页,可进行类中的方法测试
  九、使用RemoteObjectAMF0时将renaun_com_RemoteObjectAMF0.zip解压把src下的
  com文件夹整体复制到flex项目中;
  注意路径与mxml同路径;
  RemoteObjectAMF0.as中的override public function setCredentials( username:String, password:String):void)修改成override public function setCredentials( username:String, password:String,charset:String=null ):void)
  添加xmlns:renaun="com.renaun.rpc.*"到<mx:Application ……中。
  十、使用普通RemoteObject在mxml的同目录下添加services_config.xml文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service id="remoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="fluorine">
<channels>
<channel ref="my-amf"/>
</channels>
<properties>
<source>*</source>
</properties>
</destination>
</service>
</services>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost:12432/ReomteFlex/Gateway.aspx" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
</services-config>
  注:http://localhost:12432/ReomteFlex/Gateway.aspx随项目启动的端口变化。
  之后,Flex项目右键-属性-Flex compiler-compiler参数(-locale en_US -services "services_config.xml")

posted on 2014-07-16 09:40 顺其自然EVO 阅读(187) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2014年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜