The Dev Pages

A knowledge base for simple (and beyond) web applications development




Flex Remoting with Coldfusion. Coldfusion Services and custom objects/components

I was getting frustrated when I COULD NOT receive a flex object as anything when a coldfusion service was receiving a remote call from flex. The coldfusion component had a method I was sending a call to. This method expected a struct arguement and then I was trying the argument type as on object. When I passed in the flex object to the remote method call in flex, when coldfusion received the argument it was breaking it apart and treating it as a messed up argument collection. Turns out you have to wrap a flex object in another object for coldfusion to receive it as a struct. Why the lack of documentation on this? I think flex remoting is really cool, but maybe it is a newer wave of development that just hasn’t been very popularized yet. I think that is changing.

In any case the following links really help with understanding how coldfusion and flex work together with remoting. Coldfusion components, like custom TO objects, can also be used across the wire, and vice-versa with flex objects. It is pretty slick, but you have to learn how to make coldfusion components and corresponding flex objects with properties that match, etc.

Nice article by Joel.

http://www.joelconnett.com/flexobjectstocoldfusion.html

I had originally found the following, which was helpful:

http://codingmurloc.wordpress.com/2007/05/15/passing-object-to-a-cfc-flex-or-cf-bug/

For custom component types, see also:

http://www.brucephillips.name/blog/index.cfm/2006/10/26/Exchaning-User-Defined-Objects-Between-ColdFusion-and-Flex

http://www.forta.com/blog/index.cfm/2006/2/1/The-Keys-To-Getting-CFC-ActionScript-AutoConversions-To-Work

Add A Comment