




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
FluorineFX是一个开源库,提供了一种在.NET framework下对Flex/Flash的远程过程调用,Flex数据服务和实时数据的使用技术。能被.NET frameworks支持的FluorineFx有:Microsoft .NET Framework 1.1 (1.1.4322) Microsoft .NET Framework 2.0 (2.0.50727) Microsoft .NET Framework 3.5 (3.5.21022.8) Mono 1.2.4 .NET frameworks 支持向下兼容,所以新版本的框架将运行的二进制集会被定位到先前版本的框架特性Flex, Flash Remoting (RPC) Flex Messaging (partial) Flex Data Services (partial) Supports AMF0, AMF3 and RTMP protocols Service Browser Template based code generator (ASP.NET like syntax) Easily integrate rich Internet applications with .NET backend Easily integrate with Adobe Integrated Runtime (Adobe AIR)FluorineFx的配置使用“FluorineFx A Web site”向导生成的项目结构如下:除了编写.net服务器端代码,Flex客户端代码。还有非常重要的就是正确的设置配置文件。配置文件将指导如何将客户端的请求重定向到正确的服务器对象(代码中体现不出来)。打开项目根目录下的web.config。系统向导默认的配置与fluorinefx相关的部分(其他的省略了)如下: fluorinefx true FluorineFx.Proxy none false access SampleClassNet SampleClassAS ServiceName .NET Full type name MethodName .NET Method name 10240 FluorineFx.Messaging.Adapter.ApplicationAdapter . .说明:其中,部分不是必须有的 ;中的FluorineGateway http module entry 必须有;如果没有使用services-config.xml配置文件,才需要设置部分。除了根目录下的web.config文件(网站的标准配置文件外),WEB-INF/flex目录下还有四个配置文件(.xml)。由于FluorineFx是Flex Data Service的.net替代品(如果你用Java写服务器端程序,则可以直接用Flex Data Service),FluorineFx提供了和Flex Data Service相同的功能即在services-config.xml配置文件的部分配置Remoting Service, Message Service ,Data Management Service。此外,除了把所有配置都放在services-config.xml一个文件中,还可以把Service配置信息分散到多个配置文件里,然后包含进来以达到简化的效果。如下: 下表是这四个配置文件的作用:services-config.xml顶层的配置文件。包含有 Contains security constraint 定义, channel 定义, service 定义。remoting-config.xmlRemoting Service destination定义,用于访问remote objects。messaging-config.xmlMessage Service destination定义,用于publish subscribe messaging。data-management-config.xmlData Management Service destination定义。看上去这些配置文件和Flex Data Service保持一致。没错,FluorineFx 配置文件与Flex/Flash保持了统一。这四个XML格式的配置文件中可以使用的XML elements如下表:XML element描述servicesservices-config是XML配置文件的根节点,而services是services-config的第一个字节点(属于配置的顶层元素)services/service-includeIncludes files by reference that contain service definitionsservices/serviceDefinition for a service (Remoting Service, Message Service, Data Management Service)services/service/propertiesService-level propertiesservices/service/adaptersDefinitions for service adapters that are referenced in destinationsservices/service/adapters/adapter-definitionService adapter definitionservices/service/default-channelsReferences to a services default channels (when a channel is not explicitly referenced in a destination)services/service/default-channels/channelReferences to the id of a channel definitionservices/service/destinationDestination definitionservices/service/destination/adapterA reference to a service adapterservices/service/destination/propertiesDestination propertiesservices/service/destination/channelsReferences to the channels that the service can use for data transportservices/service/destination/channels/channelReferences to the id of a channel definitionservices/service/destination/securityComplete security constraint definitions or references to security constraint definitions and login command definitions that are used for authentication and authorizationservices/service/destination/security/security-constraintReferences to the id value of a security constraint definition or contains a security constraint definitionservices/service/destination/security/security-constraint/rolesNames of roles used for authorizationservices/service/destination/security/login-commandReferences to the id value of a login command definition that is used for performing custom authentication.Not supportedsecuritySecurity constraint definitions and login command definitions for authentication and authorizationsecurity/security-constraintDefines a security constraintsecurity/security-constraint/rolesNames of roles used for authorizationsecurity/login-commandDefines a login command used for custom authenticationchannelsDefinitions of message channels used to transport data between the server and clientschannels/channel-definitionDefines a message channel to transport datachannels/channel-definition/endpointSpecifies the endpoint URI and the endpoint class of the channel definitionchannels/channel-definition/propertiesProperties of a channel definition在这些配置部分,有些针对于所有的全部的Service(在services-config.xml设置),有些则专用于特定的Service(在remoting-config.xml/ messaging-config.xml/ data-management-config.xml中设置)。先看看services-config.xml中的全局设置部分:1配置message channelFluorineFx 使用Flex messaging system 中的message channel传输消息。一个channel可以让多个Service通信。FluorineFx目前不支持AMF polling channels 。在services-config.xml配置文件中可以设置AMF Channel 或者RTMP Channel。如下:这里用定义的channel,每个都有唯一的id。的uri设置的是一个接受用户请求的网关(Gateway.aspx)程序。打开这个网关程序,你可以发现程序中没有任何代码。Flex调用远程对象的流程大概如下:l Flex发出调用远程对象的请求,这个请求会被Flash Player编码成AMF;l Flex代码中定义了 Service组件,通过该组件的id,找到对应配置文件中定义的destination。l destination通过它的channel 的 id找到对应的channel定义。l 根据channel的定义,将请求发送给指定的gateway;l gateway将请求发送给gateway的后台类,将消息转换成.net格式,调用服务器上正确的类;接下来,针对Remoting Service, Message Service ,Data Management Service的配置分别进行详细说明。 一、配置RPC(remoting-config.xml)定义Remoting Service destination就是定义需要访问的remote object。Remoting service destination就是一个对象,Flex使用或 ActionScript代码连接这个远程对象。例如: !- 由于上面定义了一个默认的channel,则不需要再定义channel - ServiceLibrary.EchoService !- application - . Custom privilegedusers admins . 对上面配置的说明:1的安全设置定义了远程对象,可以使用security constraint来限制用户访问访问这个destination (只支持custom authentication)。Security constraints 可以在destination中定义,也可以在destination外面 定义,然后在destination中通过Security constraints的 id引用。2Destination adapterAdapters是服务器上的一个组件,利用Adapter,客户端才能访问远程服务器上的 service object。 Adapter 定义不是必需的, gateway 将自动配置它。默认的Remoting Adapter是flex.messaging.services.RemotingService。3Remote object 的Property element描述sourceFully qualified type name of the .NET object (remoting service)scope可以设置为 request, application, session。默认值为“ request”。如果为“request”,则Objects是无状态的stateless ( remoting service object is instantiated for every request);如果为“application”,则整个application都可以访问这个object;如果为“session”,则相同的session可以使用 (a single remoting service object is created per session).4Web service properties(还不支持)Property element描述wsdl不支持soap不支持5默认设置如果没有service配置文件,则gateway会使用下面的默认配置:*FluorineFx.ServiceBrowser.FluorineServiceBrowserFluorineFx.ServiceBrowser.ManagementServiceFluorineFx.ServiceBrowser.CodeGeneratorService二、配置 Message ServiceMessage Service destination 是就是消息传输的终端(endpoint)。在这台终端机上封装有服务器端代码,处理传输过来的消息 。使用 Producer 和Consumer 组件或ActionScript API可以连接到message service destination。例如: 20 true . Custom privilegedusers admins . .对上面配置的说明:1Message channels当前版本的FluorineFx 只支持通过Realtime Message Protocol (RTMP) channel传输消息。2Message Service adapter在FluorineFx中,默认的 Message Service adapter就是FluorineFx.Messaging.Services.Messaging.MessagingAdapter 类。所以配置文件如下设置: 如果编写MessagingAdapter类的子类,你就可以自己定义Adapter 。3Network propertiesProperty elementDescriptionsession-timeout超过这个时间(单位:分钟),a subscriber is unsubscribed。 (如果没有或者值为 0 ,则表明不会自动unsubscribe)4Server propertiesProperty elementDescriptionallow-subtopicsDestination是否支持subtopics (true/false)subtopic-separator不支持。所以总是. (点)三、配置 Data Management ServiceData Management Service destination 是一个终端。这个终端可以接收数据,或者发送数据到客户机。它提供了将数据分布到多个Data Management Service destination和 在这些destination之间进行同步(synchronization)的能力。 在Flex中使用DataService 组件或ActionScript API可以连接到Data Management Service destination。例子: samples.crm.CompanyAssembler application 20 . . 对上面配置的说明:1Message channel的选择:当前的FluorineFx 只支持使用Realtime Message Protocol (RTMP) channel 传输Data Management Services。2Data adapter的设置:FluorineFx中的 Data adapter是由 FluorineFx.DotNetAdapter 类实现的: 3Destination propertiesProperty element描述sourceFully qualified type name of the Data AssemblerscopeValid values are request, application, and session. The default value is request.cache-items不支持, 总设置成trueauto-sync-en
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 地理-2025年中考考前最后一卷试题押题猜想(陕西卷)
- 中国古代文学作品选笔记
- 初中数学九年级下册统编教案 8.2货比三家
- DeepSeek+AI大模型在工程造价领域的智能化解决方案
- 内蒙古自治区锡林郭勒盟三县联考2025届九年级下学期中考三模数学试卷(含详解)
- 洗胃试题及答案
- 五官考试题及答案
- 河南省商丘市夏邑县2025年九年级下学期模拟考试英语试卷(文字版含答案)
- 2025年四川省泸州市江阳区初中学业水平适应性考试生物学试题 (含解析)
- 2025个人汽车贷款合同常用版
- 呼吸道病原体抗体检测及临床应用课件
- 小学数学命题思考
- 战略管理教学ppt课件(完整版)
- 砌筑挡土墙搭设脚手架专项方案设计
- 太平歌词唱词
- 长篇情感电台读文(10篇)精选
- 办公楼装饰拆除工程施工方案
- DB35_T 169-2022 森林立地分类与立地质量等级
- 动火作业危害识别及控制措施清单
- 医院宁群脑高灌注综合症监测和防治
- 东方新版大学俄语第一册答案
评论
0/150
提交评论