Asp.net与Flex交互测试记录

    xiaoxiao2022-07-15  167

    一、利用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") 最新内容请见作者的GitHub页:http://qaseven.github.io/ 相关资源:敏捷开发V1.0.pptx
    最新回复(0)