In the previous articles in this series, we have described the knowledge points for using components or classes such as WebService, Httpservice, Urlloader, and fielreference to complete the communication between flex and. NET Server. It is very convenient and simple to complete the communication with the server in these ways, but his disadvantage is that the amount of communication data is small, such as to transmit a large amount of data or to achieve the serialization of different objects of transmission, they can not meet our needs, need to find another communication protocol, Another efficient transport protocol to replace the SOAP protocol transmission scheme is the AMF (ActionScript message Format) protocol.
Open Source project FluorineFX is specifically for the. NET platform and Flex communications provided by the AMF Protocol Communication Gateway, we can easily through the FluorineFX to complete communication with. Net.
FluorineFX official offers download and online documentation for installation packages that can help us effectively exploit FluorineFX.
FLUROINEFX Official website: http://www.fluorinefx.com/
Fluroinefx Download Address: http://www.fluorinefx.com/download.html
Fluroinefx online Documentation: http://www.fluorinefx.com/docs/fluorine/index.html
OK, let's take a look at the. NET and flex configurations that use FLUROINEFX communications. The development environment is selected as follows:
. Net:microsoft Visual Studio 2008 +. NET Framework 3.5
Flex:adobe Flex Builder CS3 + Flex SDK 3.2
Fluroinefx:fluorinefx v1.0.0.15
One. NET service-side development
Create a solution with Microsoft Visual Studio 2008 and add the Fluroinefx server library, as shown here:
When the FluorineFX service library is added successfully, the project template will automatically create a sample class and an Echo method for us, as follows:
1 namespace FlexDotNet.ServiceLibrary
2 {
3 /// <summary>
4 /// Fluorine sample service.
5 /// </summary>
6 [RemotingService ("Fluorine sample service")]
7 public class Sample
8 {
9 public Sample()
10 {
11 }
12
13 public string Echo(string text)
14 {
15 return "Gateway echo: " + text;
16 }
17 }
18 }