Using Flash to Access the ColdFusion Server


Flash can be used to implement the client side of ColdFusion applications. A Flash client typically interacts with a ColdFusion server in one of two ways: using web services or using Flash Remoting. Figure 17.5 shows the architecture and protocols associated with each approach.

Figure 17.5. The Flash Player (lower left) can access the ColdFusion server with either the WebServiceConnector component or Flash Remoting.


Web Services

The web services architecture enables the client to get dynamic data from servers by making requests with Simple Object Access Protocol (SOAP) and by receiving XML replies. By using standard, open protocols, web services enable any-to-any communication. For example, you can create web services that run on the ColdFusion server, and they can be accessed by clients using PHP, JSP, ASP.NET, or any other technology that supports web services standards.

Note, however, that the Flash Player's prohibition on cross-domain data transfers without a cross-domain policy file puts a serious restriction on this potential for universal communication.

Web services are best accessed from the Flash Player through the WebServiceConnector component in Flash MX 2004 Professional. The WebServiceConnector makes it easy to get the basic web services connection going.

The web services architecture requires the client to communicate with the server via a proxy, which replicates server behaviors on a local server, such as the ColdFusion server.

Dreamweaver has tools for creating ColdFusion server behaviors for use as web services. Dreamweaver also makes it easy to create the proxy for the client on the ColdFusion server. Finally, Dreamweaver makes it easy to create simple client interactions with web services.

Flash Remoting

To use Flash Remoting, you have to download the Flash Remoting components from www.macromedia.com. With the components installed, your Flash applications can communicate directly with the ColdFusion server and interact with a database.

Flash Remoting clients communicate via the Flash Remoting Gateway, a standard feature of the ColdFusion server. The Flash Remoting client invokes a function, created by the ColdFusion developer and often contained in a ColdFusion component (CFC) on the ColdFusion server. The function returns a value to the Flash Remoting client.

Flash Remoting is the most efficient way to communicate with the ColdFusion server. The ColdFusion server and the Flash client store data in the same format, eliminating the need for time-consuming translation required with technologies like XML. In addition, the proprietary Action Message Format (AFM) used for communication between client and server is efficient and compact.



Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net