Basically, Flex allows three types of RPC services: HttpService, WebServices, and RemoteObject Services.
In Flex, using the “RemoteObjects specifies named or unnamed sources and connects to an Action Message Format (AMF) gateway, whereas using the HTTPService and WebService use named services or raw URLs and connect to an HTTP proxy using text-based query parameters or XML”. Specifically, HTTPServices use raw HTTP requests, WebServices use the SOAP protocol and RemoteObjects uses AMF3.
The Flex presentation layer communicates with the business layer by using Flex data services, which are objects we insert in a Flex file. Specifically, we can use Flex data services to interact with the following:
* Web services
* HTTP services
* Remote objects
A Flex data service is an object we insert in an MXML file to communicate with the business layer of a multi-tier application. We use data services to send and receive data from web services, HTTP URLs, and remote objects such as server-based Java objects. An HTTP service is nothing more than an HTTP request to a URL. The primary purpose of HTTP services is to retrieve XML data from an external source.
“RemoteObject provides two advantages over HTTP or SOAP.
First, while the AMF protocol uses HTTP to transfer packets, the data is transferred in a binary format that is natively understood by the Flash Player. As a result, data can move across the network more quickly and it can be deserialized more rapidly than text-based formats such as XML. Both of these result in performance gains, particularly where large sets of data are involved.
Secondly, RemoteObject provides significant productivity advantages. The remoting service, which runs on our server, automatically marshals data between AMF and our server-side language (e.g., PHP, Java, C#). As a result, we can directly call methods on our PHP objects without having to write an XML REST interface or create web service interfaces”.
There are other ways to pass the data from Flex to a server-side Web application. For example, we can create an instance of the URLVariables object, create the data to be passed as its properties,attach URLVariables to URLRequest.data, and call navigateToURL().
Subscribe to:
Post Comments (Atom)
Thanks, this post helped me to make a not over web service and http service.
ReplyDelete