O'Reilly logo

Flex 4 Cookbook by Garth Braithwaite, Joshua Noble, Todd Anderson, Marco Casario, Rich Tretola

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Working with Services and Server-Side Communication

One of the most important aspects of working with Flex is communicating with a server and its exposed service methods. 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, RemoteObject, and WebService. The HTTPService class facilitates communication with a server using the Hypertext Transfer Protocol (HTTP). A Flex application can use GET or POST requests to send data to a server and process the XML or character strings that are returned from the requests. With the 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 using ActionScript Message Format (AMF), 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 service by specifying the URL of the server that will be used to send requests and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required