This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Communicating with Application Servers, Databases, and Directory Servers
|
15
Communicating with Application Servers,
Databases, and Directory Servers
Flash and the Flash Communication Server often must work with other existing
applications and resources. For example, users may have to log in against an existing
directory service or database before being allowed to chat or view streams. Database
systems can be used to store large amounts of information that FlashCom cannot
easily manage, such as millions of records that represent the location of video mes-
sages in a video email system. Each record might contain the email text and the loca-
tion of the recorded video message within a FlashCom application.
Both the Flash Player and FlashCom can interact with web application servers and,
through them, database and directory servers. The Flash client can call any server-
side script available on a web server, send and receive XML data, access web ser-
vices, and use the Flash Remoting gateway to more efficiently access application
servers. In contrast, the Flash Communication Server (as of the latest version, 1.5.2)
supports only Flash Remoting to connect to other servers. It cannot directly con-
sume web services, send or receive XML, or call a CGI script, which often compli-
cates designing applications that need to access a database or other service already
available via a web server. However, Flash Remoting is a powerful and efficient tech-
nology that can be used with J2EE, ColdFusion, and .NET servers to provide access
to databases or other services. Macromedia sells the Flash Remoting gateway sepa-
rately for J2EE and .NET servers and bundles it with ColdFusion. There are also
open source implementations of Flash Remoting for Perl, PHP, and Java. See
Chapter 11 for more details on Remoting, and see http://opensource.org for informa-
tion on open source code.
Flash Remoting is a request/response technology that allows scripts in the Flash cli-
ent or FlashCom to call remote methods on an application server. It uses HTTP to
send and receive data in the AMF. Those remote methods can retrieve information
from a database, directory server, or web server and return the information to Flash-
Com. From a developer’s point of view, Flash Remoting is easy to work with because
complex ActionScript data is serialized and deserialized automatically. Flash Remot-
ing can be used with or without FlashCom. The point is that Flash Remoting is flexi-
ble enough that it allows FlashCom to communicate effectively despite FlashCom’s
lack of direct support for XML or server-side script access.
Figure 1-5 illustrates some of the communication options for Flash and FlashCom. A
Flash client can access a web application directly, as can FlashCom.
In some cases, clients may connect to both an application server and FlashCom. In
other cases, FlashCom may connect to the application server and provide informa-
tion from or to its clients. When many clients need access to the same data, Flash-
Com should be used as an intermediary between application servers. Application
performance will be improved by reducing the number of queries from each Flash

Get Programming Flash Communication Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.