About RPC services

The RPC services feature is designed for applications in which a call and response model is a good choice for accessing external data. This feature lets you make asynchronous requests to remote services that process the requests and then return data directly to your Flex application.

A client-side RPC component, which you can create in MXML or ActionScript, calls a remote service, and then stores response data from the service in an ActionScript object from which you can easily obtain the data. The implementation of an RPC service can be an HTTP URL, which uses HTTP POST or GET, a SOAP-compliant web service, or a Java object in a Java web application. The client-side RPC components are the HTTPService, WebService, and RemoteObject components.

The following diagram provides a simplified view of how RPC components interact with RPC services:



Subtopics

Using RPC components with Flex 2 SDK only
Using RPC components with Flex Data Services

Using RPC components with Flex 2 SDK only

You can use Flex 2 SDK without Flex Data Services to create nonenterprise applications that call HTTP services or web services directly, without going through a server-side proxy service. You cannot use RemoteObject components without Flex Data Services.

By default, Flash Player blocks access to any host that is not exactly equal to the one used to load an application. Therefore, an RPC service must either be on the server hosting your application, or the remote server that hosts the RPC service must define a crossdomain.xml file.

A crossdomain.xml file is an XML file that provides a way for a server to indicate that its data and documents are available to SWF files served from certain domains, or from all domains. The crossdomain.xml file must be in the web root of the server that the Flex application is contacting.

For more information, see Understanding RPC Components.

Using RPC components with Flex Data Services

Use Flex Data Services with RPC components when you want to provide enterprise functionality, such as proxying of service traffic from different domains, client authentication, whitelists of permitted RPC service URLs, server-side logging, localization support, and centralized management of RPC services. Flex Data Services also gives you the option of using RemoteObject components to access remote Java objects without configuring them as SOAP-compliant web services.

When you use Flex Data Services, instead of contacting services directly, RPC components contact destinations. Destinations are manageable service endpoints that you manage through a server-side XML-based configuration file.

For more information, see Understanding RPC Components.


Flex 2.01

Take a survey