Sunday 22 May 2011

Remote Procedure Call (RPC) in Flex - The basic concept

Many people have asked me about RPC (Remote Procedure Call) in Flex. Although, I soon intend to publish a more detailed description about RPC, this is for you to get a basic idea of it. This write up is targeted at beginers only.

So here we go...

The “remote procedure call” architecture:

RPC (Remote Procedure Call) is an architecture wherein a software program in one operating environment can execute functions in another remote operating environment. Flex can participate in different RPC architectures.

RPC architecture typically requires a dynamic web server that responds to complex HTTP requests.

There are three RPC components and all of them communicate to the web server via HTTP protocol. They however pass different message formats between the client and server.

Following are the three RPC components:

a. HTTPService Component:

i. This component can make HTTP requests to any web server environment. It can call both dynamic and static pages.
ii. The message format used is either plain text or XML

b. RemoteObject Component:

This component uses AMF (ActionScript Message Format) to communicate between client and server.

c. WebService Component:

This Component uses SOAP message format to communicate between client and server.

Note*: RemoteObject and WebService components cannot communicate to any web server unlike HTTPService component.
RemoteObject component works only with servers that implement AMF, like ColdFusion, Blaze DS, LiveCycle data services, etc. On the other hand WebService component works with only those servers that support SOAP protocol like ColdFusion, vdzf b ASP.NET, and J2EE.

More to follow soon ;)