Using Flex, you can choose between three different strategies to access back-end data.
With HTTPService, your client application can send traditional HTTP requests to a server and consume the response. Although you can use your HTTPService to consume different types of responses, you typically use it to consume XML (XML over HTTP). You can use the HTTPService to send requests to any kind of back-end system: JSP, Servlet, ASP, ColdFustion, CGI, PHP, and so forth.
With RemoteObject, your client application can invoke methods in Java objects deployed in your application server and consume the return value of these methods. The return value can be a value of primitive data type, an object, a collection of objects, and so forth.
With the WebService component, your client application can invoke methods in web services deployed in your application server or anywhere on the network, and consume the return value of these methods. The return value can be a value of primitive data type, an object, a collection of objects, and so forth.
In this section, you experiment with these three approaches to access back-end data. You create an application that displays a list of restaurants in a DataGrid. You successively use HTTPService, RemoteObject, and WebService to retrieve the list of restaurants.
Upon completion of this module the application will look like Figure 4:

Figure 4. The data services module