Asp.net与Flex交互测试记录

发表于:2014-7-15 11:04

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:Ranran    来源:51Testing软件测试网采编

  一、利用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")
21/212>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号