Flex RemoteObject if ColdFusion isn't on your workstation
April 10, 2009
Here's a quick tip if you write Flex applications that talk to ColdFusion via RemoteObject calls and you don't have ColdFusion installed on your workstation.
When you create a Flex Builder project, set the "Application Server Type" to none. This means that Flex Builder doesn't need to be able to access you ColdFusion install (to read services-config.xml). Now all you need to do is set up an endpoint in your code.
This can be done as an attribute of you RemoteObject tag like this:
<mx:RemoteObject id="svcColdFusion" destination="ColdFusion" endpoint="http://myservername/flex2gateway/" />
Or if you prefer, in actionscript:
svcColdFusion:RemoteObject = new RemoteObject( "ColdFusion" );
svcColdFusion.endpoint = "http://myservername/flex2gateway/"
If you don't want to hard code your domain name, then you can always create the endpoint dynamically:
svcColdFusion.endpoint = "http://{server.name}:{server.port}/flex2gateway/"
If I'd known this when I started using Flex to call ColdFusion I'd have saved hours!
- Posted in:
- ColdFusion
- Flex
7 comments
Leave a comment
If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)





Such as: www.aliaspooryorik.com/flex2gateway/
/>
??
It's kinda weird to be able to do that huh?
Comment by Marcos Placona – April 21, 2009
And that is why security is important :-)
I'm talking about how ColdSpring's AOP system can help with this at the end of my SOTR talk in Manchester :-)
Comment by Tom Chiverton – April 21, 2009
Comment by John Whish – April 21, 2009
Comment by Tom Chiverton – April 21, 2009
Comment by Tom Chiverton – April 21, 2009
Comment by John Whish – April 21, 2009
Comment by Sean Sekora – June 07, 2009