1 定义:
FluorineFX是一个开源库,提供了一种在.net FrameWork下对Flex/Flash的远程过程调用,Flex数据服务和实时数据的使用技术。能被.net Frameworks支持。
2 特性:
- 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 llike syntax)
- Easily integrate rich internet applications with .net backend
- Easily integrate with Adobe integrated Runtime(Adobe AIR™)
3 FluorineFx的配置
使用"FluorineFx Asp.net Web Site"向导生成的项目结构如下:(Adobe AIR™)
4 Web.Config关于Fluorinefx相关部分如下:(如果不用web-inf/flex目录下的services-config.xml)
<fluorinefx>
<settings>
<!-- Reflection optimizer provider="codedom|il" debug="true|false" -->
<optimizer provider="codedom" debug="true"/>
<wsdlGenerateProxyClasses>true</wsdlGenerateProxyClasses>
<wsdlProxyNamespace>FluorineFx.Proxy</wsdlProxyNamespace>
<!-- Time Zone Compensation ="none|auto" -->
<timezoneCompensation>none</timezoneCompensation>
<!-- Any value-type that is not explicitly initialized with a value will contain the default value for that object type -->
<acceptNullValueTypes>false</acceptNullValueTypes>
<!-- value="browse|access" -->
<remotingServiceAttribute>access</remotingServiceAttribute>
<classMappings>
<classMapping>
<type>SampleClassNet</type>
<customClass>SampleClassAS</customClass>
</classMapping>
</classMappings>
<services>
<service>
<name>ServiceName</name>
<service-location>.NET Full type name</service-location>
<methods>
<remote-method>
<name>MethodName</name>
<method>.NET Method name</method>
</remote-method>
</methods>
</service>
</services>
<!-- 如果services-config.xml没有使用,才需要设置security部分-->
<security>
<login-command class="FluorineFx.Messaging.Security.GenericLoginCommand" server="asp.net"/>
</security>
<cache>
<cachedService timeout="30" slidingExpiration="false" type=".NET Full type name"/>
</cache>
<importNamespaces>
<add namespace="Namespace name to import" assembly=""/>
</importNamespaces>
<nullable>
<type name="System.Int32" value="MinValue"/>
<type name="System.Double" value="MinValue"/>
<type name="System.DateTime" value="MinValue"/>
<type name="System.Guid" value="Empty"/>
</nullable>
<!-- preferredAlgorithm="deflate|gzip" compressionLevel="high|normal|low" handleRequest="all|amf|none" -->
<httpCompress preferredAlgorithm="gzip" compressionLevel="high" handleRequest="all">
<!-- compress responses larger then threshold bytes-->
<threshold>10240</threshold>
<excludedMimeTypes>
<add type="image/jpeg"/>
<add type="image/png"/>
<add type="image/gif" />
<add type="application/zip" />
<add type="application/x-zip-compressed" />
<add type="application/x-gzip-compressed" />
<add type="application/x-compressed" />
<add type="application/octet-stream" />
<add type="application/pdf" />
</excludedMimeTypes>
<excludedPaths>
<!--Fluorine service browser scripts and resources -->
<add path="FluorineWebResource.axd"/>
<add path="FluorineCodeGenerator.aspx"/>
<!--standard .NET validating scripts and postback script -->
<add path="WebResource.axd"/>
<!--MS AJAX and has it's own compression module that will take care of the AJAX scripts -->
<add path="ScriptResource.axd"/>
</excludedPaths>
</httpCompress>
<application-handler>FluorineFx.Messaging.Adapter.ApplicationAdapter</application-handler>
<sharedObjectService type="FluorineFx.Messaging.Rtmp.SO.SharedObjectService">
<persistence type="FluorineFx.Messaging.Rtmp.Persistence.FileStore"/>
</sharedObjectService>
<fluorineContextFactory type="FluorineFx.Context.FluorineRtmpContextFactory"/>
<rtmpServer>
<threadpool minWorkerThreads="0" maxWorkerThreads="25" idleTimeout="60000"/>
</rtmpServer>
</settings>
</fluorinefx>
...
<system.web>
<httpModules>
<add name="FluorineGateway" type="FluorineFx.FluorineGateway, FluorineFx" />
</httpModules>
</system.web>
说明:其中,<fluorinefx />部分不是必须有的 ;<httpModules />中的"FluorineGateway" http module entry 必须有;如果没有使用services-config.xml配置文件,才需要设置<security />部分。
5 除了把所有配置都放在services-config.xml一个文件中,还可以把Service配置信息分散到多个配置文件里,然后包含进来以达到简化的效果。如下: