Probably the easiest thing to do is to setup a crossdomain.xml file on your CF server. This should be setup to allow SWFs hosted on your FDS server to make connections to CF. For the CF side of things, you can probably leave the configuration with its defaults. You just need to take a look at the <endpoint> uri attribute in the channel-definition and then set that as the endpoint attribute on the <mx:RemoteObject> tag, and then consider the remoting service destination. You can either create your own destination or rely on the default "ColdFusion" destination and its special <source>*</source> wildcard (if a wildcard is used it means the client will provide the source at runtime... i.e. specified on the <mx:RemoteObject> tag using the source attribute and hence sent in every RemotingMessage sent to CF. If you're not using the MXML API for RemoteObject, i.e. you want to use ActionScript APIs, you have to programmatically create a ChannelSet that contains at least one Channel implementation... likely to be AMFChannel (although if you want to use HTTPS, you'd use SecureAMFChannel). var channel:AMFChannel = new AMFChannel(null, "http://myserver:8500/cfusion/flex2gateway/"); var channelSet:ChannelSet = new ChannelSet(); channelSet.addChannel(channel); myRemoteObject.channelSet = channelSet; (You can use programmatic channelsets for lots of reasons such as random server selection for client controlled load balancing or just simply a list of channels to try in a failover scenario). As for the FDS <mx:DataService> side of things, you just need to specify -services=/path/to/your/fds/WEB-INF/flex/services-config.xml on the command line when compiling your MXML application. The RemoteObject API won't look at this config if you specify a custom endpoint or programmatically provide a ChannelSet. The reason why you use a services configuration file for DataService (and not necessarily for RPC services like RemoteObject) - is because the compiler does more than just code-gen ChannelSets for you - it also sets up association properties and establishes the necessary metadata to allow DataService destinations to lazily load properties managed by an association. Pete
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Darren Houle Sent: Thursday, March 15, 2007 7:41 PM To: [email protected] Subject: RE: [flexcoders] FDS to CF RemoteObject Peter, Awesome advice, yes, I've found several reasons I'd rather do it programatically. Thanks! But... my question still remains.... what channel(s), adapter(s), and destination setting(s) do I use (xml or programatically) to have my Flex client, served from an FDS server, call ROs on a paralell CF Ent server? Darren >From: "Peter Farland" <[EMAIL PROTECTED] <mailto:pfarland%40adobe.com> > >Reply-To: [email protected] <mailto:flexcoders%40yahoogroups.com> >To: <[email protected] <mailto:flexcoders%40yahoogroups.com> > >Subject: RE: [flexcoders] FDS to CF RemoteObject >Date: Thu, 15 Mar 2007 13:32:43 -0700 > >In FDS 2.0.1 and CF 7.0.2 I would use the services-config.xml for the >new Flex Data Management stuff, and just programmatically create a >ChannelSet for my RemoteObject and avoid channel configuration for this >simpler use case. For RPC services like RemoteObject, compiling against >a config file is only meant to be a convenience so that the compiler >will generate some code for you to create a matching ChannelSet for a >destination... you can always just do this yourself in ActionScript. > >Pete > >________________________________ > >From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On >Behalf Of Darren Houle >Sent: Thursday, March 15, 2007 3:56 PM >To: [email protected] <mailto:flexcoders%40yahoogroups.com> >Subject: [flexcoders] FDS to CF RemoteObject > > > >I have built a Flex app that loads from the CF server and successfully >calls >a RemoteObject (CFC) back on that same CF server. I'm using the basic >"ColdFusion" destination in the services-config.xml which looks like... > ><channels> ><channel-definition id="my-cfamf" >class="mx.messaging.channels.AMFChannel"> ><endpoint >uri="http://{server.name}:{server.port}/{context.root}/flex2gateway/" >class="flex.messaging.endpoints.AMFEndpoint"/> ><properties> ><polling-enabled>false</polling-enabled> ><serialization> ><instantiate-types>false</instantiate-types> ></serialization> ></properties> ></channel-definition> ></channels> > ><services> ><service id="coldfusion-flashremoting-service" >class="flex.messaging.services.RemotingService" >messageTypes="flex.messaging.messages.RemotingMessage"> ><adapters> ><adapter-definition id="cf-object" >class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/> ></adapters> ><destination id="ColdFusion"> ><channels> ><channel ref="my-cfamf"/> ></channels> ><properties> ><source>*</source> ><access> ><use-mappings>false</use-mappings> ><method-access-level>remote</method-access-level> ></access> ><property-case> ><force-cfc-lowercase>false</force-cfc-lowercase> ><force-query-lowercase>false</force-query-lowercase> ><force-struct-lowercase>false</force-struct-lowercase> ></property-case> ></properties> ></destination> ></service> ></services> > >That works fine, but I have just installed FDS w/integrated Jrun on the >same >physical box CF Enterprise is running on. What I need to do is move this > >Flex app to the newly installed FDS server so that I can add Data >Management >functionality to the app, but I want the app to also continue using that > >existing RemoteObject call. I realize I can't use the same CF channel or > >service definitions in the FDS services-config.xml, but what do I use? >I've >tried many unsuccessful combinations including... > ><channels> ><channel-definition id="cf-amf" >class="mx.messaging.channels.AMFChannel"> ><endpoint uri="http://localhost/{context.root}/messagebroker/amf" >class="flex.messaging.endpoints.AMFEndpoint"/> ><properties> ><polling-enabled>false</polling-enabled> ></properties> ></channel-definition> ></channels> > ><services> ><service id="remoting-service" >class="flex.messaging.services.RemotingService" >messageTypes="flex.messaging.messages.RemotingMessage"> ><adapters> ><adapter-definition id="java-object" >class="flex.messaging.services.remoting.adapters.JavaAdapter" >default="true"/> ></adapters> ><default-channels> ><channel ref="cf-amf"/> ></default-channels> ><destination id="TransferCenterAuth"> ><properties> ><source>*</source> ><scope>request</scope> ></properties> ></destination> ></service> ></services> > >Is there a simple solution for using RO's in FDS when redirecting them >to a >parallel CF server, or do I have to set up all kinds of complicated >channels, destinations, and messaging gateways on both servers just to >call >a RO? > >Thanks! > >Darren > > > >

