MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Spezifikationen Seite 11

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 40
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 10
This is the Title of the Book, eMatter Edition
Copyright © 2003 O’Reilly & Associates, Inc. All rights reserved.
How Does Flash Remoting Work?
|
9
.....
/1/onResult...null.....
Hello World from ColdFusion Component
We can gain some insight into AMF by examining the request and response:
The content type of AMF is
application/x-amf.
The AMF data is contained within the body of the request and response; it is pri-
marily binary and is therefore difficult to show in print.
There are human-readable strings within the AMF data.
The last point tells us that AMF is not entirely compressed. However, even uncom-
pressed, the protocol is very efficient at serializing ActionScript data.
AMF has a number of advantages over traditional Flash data serialization tech-
niques, such as XML and URL-encoded query strings, including:
AMF is a binary format and thus creates serialized data that is smaller than using
string-based encoding. This translates into lower bandwidth requirements and
faster loading and response times.
AMF was built specifically with Flash ActionScript datatypes in mind. There-
fore, it can be serialized quickly and efficiently from ActionScript objects and
deserialized into ActionScript objects within the Flash Player. In almost all cases,
this leads to significant performance increases over string-based serialization.
Why does Flash Remoting use AMF instead of SOAP to communicate with the Flash
Player? After all, SOAP was designed as a lightweight protocol for the exchange of
information in a distributed environment, which sounds similar to the goals for
AMF. Both SOAP and AMF can transfer data and make calls on remote services, and
both work over standard HTTP and HTTPS. There are several reasons why Macro-
media developed AMF instead of using SOAP:
SOAP is implemented as XML and is therefore rather verbose compared to the
binary AMF.
AMF is designed and optimized to work with Flash ActionScript datatypes.
Deserializing AMF in the Flash Player is much more efficient than parsing and
deserializing SOAP, because AMF has direct support for ActionScript datatypes
whereas SOAP is a general-purpose protocol. Even if SOAP messages were com-
pressed, serialization in AMF would still be more efficient.
Adding AMF support to Flash Player 6 required only a small increase in the
Player size (about 4 KB compressed), maintaining its slim footprint.
Integrating full SOAP support on the client side, with acceptable performance,
requires an increase in Player size. Although Flash Player 6 includes XML sup-
port, it does not support some headers required by SOAP. Using Flash Remot-
ing, Flash can access SOAP-based web services even though Flash Player 6
doesn’t support SOAP directly. That is, the Flash Remoting gateway translates
SOAP requests to and from AMF format on the server-side and then uses AMF
Seitenansicht 10
1 2 ... 6 7 8 9 10 11 12 13 14 15 16 ... 39 40

Kommentare zu diesen Handbüchern

Keine Kommentare