Let's talk about Flex, AIR, ActionScript, ColdFusion and more    

New API HTTPMultiService and HTTPOperation in Flex 3.4


I wonder why they added these APIs in this timing. But it's useful a little.

Summary of advantages of these API

You can use HTTPService like RPC method.

You don't get it? Then, see source of following samples

syntax sample in ActionScript
HTTPMultiServiceSample
source

syntax sample in MXML
HTTPMultiServiceSample2
source


You don't get it though you saw source a bit?

The unit of HTTPService was the URL in Flex 3.2 or earlier. Also the communication method is always "send". However, some people want to use HTTPService like RPC. Now, you can use HTTPService like RPC with HTTPMultiService and HTTPOperation.

MXML syntax is like this


And ActionScript syntax when you call the service is like this.

The method is still "send". But this looks like RPC than before. Also Flex 3.4 has huge change. In Flex 3.2 or earlier, HTTPService/WebService/RemoteObject were definition class and also execution class. But now, HTTPService/WebService/RemoteObject are just definition class. And execution classes are each "Operation" classes now (* event.currentTarget is each "Operation" class at result/fault handler).

And each "Operation" classes are ...

mx.rpc.http.Operation class is mx:HTTPOperation in MXML, mx.rpc.soap.Operation class is mx:WebServiceOperation in MXML, mx.rpc.http.Operation class is mx:RemoteObjectOperation in MXML

However, you can't do like this for now.


I have no idea why we can't do like this. Someone in Flex team might be able to answer this question.


Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.5.005.