Working with Request/Response Data Communication

You can work with request/response data communication in three basic ways: via simple HTTP services (including REST services and services using JSON), SOAP web services, and Remoting. Each achieves the same basic goal of sending a request and receiving a response, and as such you can use them for the same purposes within Flex applications. Which method you choose depends primarily on what type of service you have available. For example, if you want to load XML data from an XML document you should use simple HTTP service communication. However, if you want to call a web service method, you should use web services communication.

Simple HTTP Services

The most basic type of HTTP request/response communication uses what we call simple HTTP services. These services include things such as text and XML resources, either in static documents or dynamically generated by something such as a ColdFusion page, a servlet, or an ASP.NET page. Simple HTTP services might also include pages that run scripts when called in order to do things such as insert data into or update databases or send email. You can use simple HTTP services to execute these sorts of server behaviors, to load data, or to do both.

Flex provides two basic ways in which you can call simple HTTP services: using HTTPService, a Flex framework component; and using the Flash Player class flash.net.URLLoader.

HTTPService

HTTPService is a component that allows you to make requests to simple ...

Get Programming Flex 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.