RPC services allows you to make asynchronous calls to remote services that process the request and return the data back to the application. You define an RPC component in MXML using the <mx:RemoteObject>, <mx:HTTPService>, or <mx:WebService> tag. The client RPC component calls a remote service, which then stores the response in an ActionScript object from which you can access the data.
Figure 11-1 shows how RPC components interact with RPC services.
Figure 11-1: RPC components interact with RPC services
RPC Components with Flex 2 SDK
You can use the Flex 2 SDK without FDS to create applications that call HTTP or Web services without a going through a proxy service. The <mx:HTTPService/> and <mx:WebService/> components send data either using HTTP or SOAP format.
If you want to call remote services using the RemoteObject components, you should use FDS for Java objects or ColdFusion MX 7.0.2 with the Remoting Update. The data format for these two solutions would be Action Message Format (AMF) version 3.
Following are some third-party solutions that achieve functionality similar to FDS or ColdFusion:
-
WebORB – Midnight Coders (http://www.themidnightcoders.com) offers a product called WebORB, which is a platform-enabling development, deployment, and run-time execution of Rich Internet Applications. The product facilitates connectivity between rich clients created with Flex, Flash, or Ajax, and server-side applications developed with .NET, Java, Ruby on Rails, PHP, or XML Web Services. They all implement AMF0 and AMF3 protocols, and FDS. As of this writing, the full implementation of the Flex Data Management Services functionality will be available only in the commercial edition of the WebORB products.
-
AMFPHP – AMFPHP is a free Open Source Flash Remoting gateway that is fast and reliable. You can check it out at http://www.amfphp.org.
-
OpenAMF – The OpenAMF project (http://www.openamf.com) is a free Open Source alternative to Macromedia’s Java Flash Remoting. It is as capable of providing application services to Flash MX as Macromedia’s proprietary solution. This project began as a Java port of AMF-PHP.
-
RemoteObject component for AMF0 – If you would like to use AMFPHP or OpenAMF, you must download a modified version of the RemoteObject components that Flex 2 provides for RPC services. This will allow you to call PHP or Java remote objects using the AMF0 protocol. The RemoteObjectAMF0 component, which was written by Renaun Erickson (http://renaun.com/blog/flex-components/remoteobjectamf0), provides functionality to connect Flex 2 applications with AMF0 remoting servers.
RPC Components with FDS
RPC components and FDS provide you with enterprise functionality, such as client authentication, proxying of services from different domains, white lists of permitted RPC service URLs, server-side logging of data, localization support, and centralized management of RPC services.
Instead of contacting services directly, RPC components contact their relevant destinations, which are service endpoints that you can manage through a server-side XML file.

