The basic concept of the AMF protocol is learned in XML text data. As I learned about this protocol, I found that its use is no longer limited to one method. It has also been presented in many other fields. Now let's get to know this agreement.
Action Message Format (AMF) is an Adobe protocol used for data interaction and Remote Process calling. It is functionally equivalent to WebService, however, the difference between AMF and XML in WebService is that AMF is binary data while XML is text data, and AMF transmission efficiency is higher than XML. AMF uses HTTP transmission, currently, it is mainly used in ActionScript to implement communication between Flex and Server. Currently, there are two versions: AMF0 and AMF3.
The biggest feature of the AMF protocol is that Flash built-in objects such as Object, Array, Date, and XML can be directly transmitted back to the server and automatically parsed to appropriate objects on the server, this reduces the complexity of developers' work and saves development time. Because AMF uses binary encoding, this method can compress data highly, therefore, it is very suitable for transferring a large amount of data. The larger the data volume, the higher the transmission efficiency of Flash Remoting, far exceeding the Web Service. For XML, LoadVars and loadVariables (), they use plain text transmission, and their efficiency cannot be compared with Flash Remoting 。
It is also a lightweight Data Exchange Protocol, also by calling remote services, also based on standard HTTP and HTTPS protocols, why does Flash Remoting choose to use AMF and discard the communication between SOAP and Flash players? The reasons are as follows:
1. SOAP processes data in XML format, which is too lengthy compared with the binary atom File System (AES;
2. AMF can serialize data more effectively, because the original intention of AMF protocol is to support the data type of Flash ActionScript, but SOAP is committed to providing more extensive use;
AMF has evolved from AMF0 in the Flash MX era to AMF3 now. AMF3 is used as the default serialization format of ActionScript 3.0 in Flash Playe 9, AMF0 is used as the serialization format of the old versions of ActionScript 1.0 and 2.0. AMF3 is more efficient in data transmission over the network than AMF0. AMF3 can transmit int and uint objects as integers, it also serializes data types supported by ActionScript 3.0, such as ByteArray, XML, and Iexternalizable 。
AMF (Action Message Format) is a binary format data type. The flash data is encoded by AMF over HTTP and sent back to the server, after the remoting adaptor of the server receives the data, it decodes the correct native object and submits it to the correct program for processing, it is also widely used for Local Connection and Flash communication server. Its biggest characteristic is that flash native object can be directly used.
For example, an Object, Array, Date, XML is returned to the server, and the server is automatically translated into an appropriate Object. For example, when the flash Array is returned to PHP, it is automatically converted to the Associative Array; the biggest benefit of this feature for developers is that they do not need to manually process the complicated work of serialization and deserialization, which is not only more accurate, at the same time, development also saves time. Because the AMF protocol is binary format and the encoding is highly compressed, It is very suitable for transmitting a large amount of data, according to the flashorb website test (mainly for web service and flash remoting), when the data volume increases, the transmission efficiency of flash remoting is higher, far exceeding the performance of web service, therefore, we can also find that the transfer methods using plaine text format, such as xml, loadVars, and loadVariables, are naturally Unparalleled.