ActionScript Messaging Format (AMF) is a binary protocol meant to allow a Flash application,
sitting on the user's browser, to communicate with the backend web server. AMF enables developers
to build powerful flash-based applications driven by databases and rich business layers.
AMF.NET is a .NET gateway sitting between a Flash movie and .NET code. The goal of AMF.NET
is to promote proper N-Tier development by allowing your existing business layer (written
in .NET) to be consumed by Flash without requiring any modification.
Technically, AMF.NET can best be described by breaking it down into 3 distinct parts.
First, the AMF stream is received by the gateway and
deserialized. Second, based
on the received stream, the appropriate .NET code is
executed. Finally, the response is
serialized and outputted back to the Flash movie.
Deserialization
Deserializing consists of reading the binary AMF format from the Response.InputStream and turning
it into meaningful data that'll let us execute the package. A major part of that consists
of mapping flash data types to .NET data types. The format of the stream is
explained in detailed at
OSFlash.
Execution
Execution uses the deserialized data from the first step and executes the requested method
via reflection. Any exceptions thrown within the execution step will be returned to Flash in
the onStatus handler (as opposed on onResult for successful calls). The execution step does
more work to try and gap the different data types.
Serialization
Serialization takes the value returned from the executed method and packages it back into the AMF
response format. The package is written to the OutputStream.