Hey Thomas,
I should point out that you have a few options when
connecting to ColdFusion from a Flex 2 application (well, for any Flex 2
application but I'll keep this reply CF focused).
The first thing I want to mention is that for RPC
services like RemoteObject, and WebService and HTTPService (when using the
proxy) you can avoid specifying a services-config.xml file so long as you
take on the responsibility of programmatically specifying where the channel
endpoint(s) are for a service. I would suggest this approach if you are
connecting to an endpoint other than FDS and you're not comfortable futzing with
the configuration across two app servers.
1. The first way to specify a set of channels that can be
tried to find a suitable endpoint to communicate with a destination. This
approach is hinted in the docs...
... but to make it more explicit I'll reproduce the
relevant ActionScript code here:
import mx.messaging.ChannelSet;
import mx.messaging.Channel;
import
mx.messaging.channels.AMFChannel; ...
var cs:ChannelSet = new ChannelSet(); var customChannel:Channel = new AMFChannel(null, "http://localhost:8700/cfusion/flex2gateway/"); cs.addChannel(customChannel); myRemoteObject.channelSet = cs; ... Note that we pass a null channel id to the channel
constructor so that we don't have to know what the channel-definition is called
in the relevant /WEB-INF/flex/services-config.xml file. The channel id is only
to help services catch a mistaken channel assignment which is only really
important for publish/subscribe services as if one were to assign a non-polling,
non-real-time channel you'd never received pushed updates.
Also note this approach should work for other RPC services
too (well, it is true for publish/subscribe services too like
Producers/Consumers for the FDS message service and the data management
services).
2. Another quick and dirty way to do this for the MXML API
of RemoteObject ONLY is to use the legacy endpoint
attribute:
<mx:RemoteObject id="myRemoteObject" endpoint=http://localhost:8700/cfusion/flex2gateway/ ... />
Under the covers the MXML tag will use the endpoint to
create a default channel set for you (it'll use AMFChannel for URLs starting
with http, and SecureAMFChannel for URLs starting with
https).
Pete
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Rühl Sent: Tuesday, October 17, 2006 5:52 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] [Flex 2] Crossdomain issue
-- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |