Flex Data Server and CF Flash Remoting together
A common configuration question with Flex2 developers who are trying to use the Flex Data Server and CF is "How do I use FDS and Flash Remoting calls with CF, in the same app?". The reason this gets confusing is because both Flex and CF have their own version of the services-config.xml file, and you can only point to one file in your flex builder project. So which one do you use?
First off, do not try to merge the CF and Flex2 servers into the same instance. In other words if you find yourself trying to merge the web.xml files, like you did with CF and Flex 1.5 - STOP! Don't do it. You don't need to do it with flex2. Instead you want set up your servers and your project like this.
1) Configure CF on 1 instance/server
2) Configure FDS on 2nd instance/server
3) Point your project at the services-config.xml in the FDS instance.
Ok at this point you can easily call FDS destinations which uses CF (or not). Now to also make Flash remoting requests to CF.
4) Define the destination and channel with Actionscript, instead of letting the compiler do it when it is pointed at the CF version of the services-config.xml
To create you own ChannelSet the code would look something like this.
public function initApp()
{
cSet = new ChannelSet();
var customChannel:Channel = new AMFChannel("my-cfamf", http://localhost:8500/flex2gateway/);
// Add the Channel to the ChannelSet. cSet.addChannel(customChannel);
foo.channelSet = cSet;
}
<mx:RemoteObject
id="foo"
destination="ColdFusion"
source="com.foo.component" />

Many of us were stuck how to implement this without having FDS throwing errors all over.
Thank you, thank you, thank you!
I setup the two instances (fds,cf) and pointed my project at the services-config.xml in the fds instance but I cannot seem to call any cfc in the cf instance. I am just trying to get something simple working like a helloworld.
Nick
Also Start both servers from the command line, that way you can see if there are any errors during startup.
If you want to call CF with Flash Remoting, then you need to point to the FDS services-config.xml. But you need to define the endpoint url and channel in your code directly. (instead of letting flex pull it out of the services-config.xml).
hth
Thanks,
Ryan
The test.cfm dumps OK, which is a start. See http://208.106.227.101/Phones/bin/CF/test.cfm
But the "Phones" app itself just shows a blank grey screen after the initializing bar finishes loading. See http://208.106.227.101/Phones/bin/phones.html
If anybody can work with me to get this going, I'd appreciate it. Name your price! I have documented every step of what I have done so far including screen shots of all path entries etc in FlexBuilder2. From this, somebody might be able to see where I'm going wrong.
Email me at xxxchinabuy01@yahoo.comxxx. (Remove three x's from each end first).
Paul
does that answer you question?
public function initApp()
{
cSet = new ChannelSet();
var customChannel:Channel = new AMFChannel("my-cfamf", http://localhost:8500/flex2gateway/);
// Add the Channel to the ChannelSet. cSet.addChannel(customChannel);
foo.channelSet = cSet;
}
however, taking a guess I think I see the confusion, you said
>Well we're now defining the channel in as. not in service-config, right?
that is wrong. We still have to define the channel in the services-config.xml. So the server will work correctly. This is just a different way to link the client to it. What my code is doing for you is removing the requirement to link the client to the services-config.xml in the compiler arguments. And allows you to change the url or path at runtime, which is not allowed with the standard -services compiler argument (which is how all of the docs explain it).
All of the settings in the services-config.xml are used by the server to operate properly. So they still need to be defined. All the client cares about is what url do I use to access the server. Why the flex team decided to use the same file for the client configuration and server configuration is what causes all of the headaches (especially if your not developing locally).
boybels
"Could not pre-load servlet: MessageBrokerServlet flex.messaging.config.ConfigurationException: channel not found for reference 'my-cfamf' in destination 'ColdFusion'..." error when starting FDS.
Following is the code I pasted between the <sevices></services> tags. What am I doing wrong??
Boybles
<service id="coldfusionsamples-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>
<!-- define the resolution rules and access level of the cfc being invoked -->
<access>
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
<use-mappings>false</use-mappings>
<!-- allow "public and remote" or just "remote" methods to be invoked -->
<method-access-level>remote</method-access-level>
</access>
<property-case>
<!-- cfc property names -->
<force-cfc-lowercase>false</force-cfc-lowercase>
<!-- Query column names -->
<force-query-lowercase>false</force-query-lowercase>
<!-- struct keys -->
<force-struct-lowercase>false</force-struct-lowercase>
</property-case>
</properties>
</destination>
</service>
How can I help it find he adapter??
thanks,
boybles
http://needfornews.com/top_search.php
http://vidslib.com/
http://rssnewsdigest.com/top_search.php
http://realwebnews.com/
http://stocknewssite.com
http://newssiteworld.com
http://newssiteguide.com
http://newssitedirect.com
http://reportsiteworld.com
http://theofficenews.com
http://www.yahoo-seo.cn/
http://shuntong.iblog.com/
http://banqian.vipblog.hk/
http://shuntong.vipblog.hk/
http://godaday.mocasting.com/
http://jacksonwong.iblog.com/
http://tshuntong.mysinablog.com/
http://hk.geocities.com/frank_zkh/
http://hk.myblog.yahoo.com/ban-qian/
http://semarketworld.mysinablog.com/
http://www.geocities.com/cnlogistic/
http://blog.teamagazine.com.hk/fastway/
http://hk.myblog.yahoo.com/winrelocation/
http://groups.google.com/group/zoloft-buy
http://www.propeller.com/member/cheapnelson