One of the most important aspects of working with Flex is communicating with a server and database. The recipes in this chapter focus mainly on configuring a Flex application to communicate with servers and processing data sent to the application from a server in one of the three main ways that servers and applications communicate.
Flex provides three classes to communicate with servers:
HTTPService class facilitates communication with
a server using the Hypertext Transfer Protocol (HTTP). A Flex application
POST requests to send data to a server and
process XML or character strings that are returned from the request. With
HTTPService class, you can
communicate with PHP pages, ColdFusion pages, JavaServer Pages (JSP), Java servlets, Ruby on Rails, and Microsoft Active Server Pages (ASP). You
can use the
RemoteObject class for
communicating with a server via ActionScript Message Format
RemoteObjects also can
communicate with Java or ColdFusion remoting gateways or with .NET and
PHP by using open source projects such as AMFPHP, SabreAMF, or WebORB. The
WebService class communicates with a
web service that defines its interface by using the Web Services Description Language (WSDL) and uses
either SOAP-based XML or XML.
To create a service component, you need to configure the properties of the service, setting the URL of the server that will be used ...