Flex Certification » Flex Questions » What is the difference between HttpService and Data Service?
What is the difference between HttpService and Data Service?
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 Questionuery parameters or XML”. Specifically, HTTPServices use raw HTTP reQuestionuests, WebServices use the SOAP protocol and RemoteObjects uses AMF3.
You can find a detailed answer at.
http://livedocs.adobe.com/flex/3/html/help.html?content=data_intro_2.html
The Flex SDK contains features for accessing server-side data. Flex data access components are based on a service-oriented architecture (SOA). These components use remote procedure calls to interact with server environments, such as PHP, Adobe ColdFusion, and Microsoft ASP.NET, to provide data to Flex applications and send data to back-end data sources.
Depending on the types of interfaces you have to a particular server-side application, you can connect to a Flex application by using one of the following methods:
- HTTP GET or POST by using the HTTPService component
- Simple Object Access Protocol (SOAP) compliant web services by using the WebService component
- Adobe Action Message Format (AMF) remoting services by using the RemoteObject component
REST-style services
For REST-style services, you use a server resource such as a PHP page, JavaServer Page (JSP) or servlet, or ColdFusion page that receives a POST or GET request from a Flex application using the HTTPService component. That server resource then accesses a database using whatever means are traditional to the particular server technology. The results of data access can be formatted as XML instead of HTML, as might be typical with the server technology, and returned as the response to the Flex application. Flex, Adobe® Flash® Player, and Adobe AIR™ have excellent XML- handling capabilities that let you manipulate the data for display in the Flex application user interface. REST-style services provide an easy way to access a server resource without a more formalized API such as those provided by web services or remote object services. These services can be implemented using any number of server technologies that can get an HTTP request and return XML as the response.
Web services
SOAP-compliant web services are a standardized type of REST-style service. Rather than accessing a PHP, JSP, or ColdFusion page specifically, a Flex application accesses a web service endpoint. Based on published specifications, a web service knows the format in which the data was sent and how to format a response. Many server technologies provide the ability to interact with applications as web services. Because web services comply with a standard, you don’t need to know the implementation details of the code with which a Flex application interacts. This is particularly useful for applications, such as business-to-business applications, that require a high degree of abstraction. However, SOAP is often very verbose and heavy across the wire, which can result in higher client-side memory requirements and processing time than working with informal REST-style services.
Remote object services
Remote object services let you access business logic directly in its native format rather than formatting it as XML, as you do with REST-style services or web services. This saves you the time required to expose existing logic as XML. When using Adobe® LiveCycle™ Data Services ES, Vega, or ColdFusion, a Flex application can access a Java object or ColdFusion component (which is a Java object internally) directly by remote invocation of a method on a designated object. That object on the server can then deal with its native data types as arguments, query a database from those arguments, and return its native data types as values.
Another benefit of remote object services is the speed of communication across the wire. Data exchanges still happen over HTTP or HTTPS, but the data itself is serialized into a binary representation. This results in less data going across the wire, reduced client-side memory usage, and reduced processing tim
Filed under: Flex Questions









[...] Link: What is the difference between HttpService and Data Service … [...]