views:

548

answers:

3

I'm a Coldfusion developer looking to break into Flex. I have a couple test Flex applications i'm working on, but am having problem connecting to my CFC's. I've tried creating mappings in CFAdmin, putting the CFC in the same folder as the Flex app, putting the CFC in the C:\Coldfusion8\Gateway\CFC folder, all to no avail. Each time, I get the "Could not find the ColdFusion Component or Interface" error.

What am I missing?

Here is how i'm invoking the CFC for Flex use.

 <mx:RemoteObject id="conn" destination="ColdFusion" source="cfc.bulkmail"
 result="orderGrid.dataProvider = event.result;" showBusyCursor="true">
A: 

I had similar problems on certain servers. I think it has something to do with how security is setup on your website. I ended up taking the easy route and making my CFC methods remotely accessible and calling them as WebServices.

Eric Belair
A: 

C:\Coldfusion8\wwwroot\Gateway\CFC is the correct folder and the cfc.bulkmail is the correct source.

It works, I must've just not had the proper case at one point or the other.

But here's the answer for anyone who has the same problem in the future.

Gene R
+2  A: 

You can also go into your remoting-config.xml file ([coldfusionRoot]wwwroot\WEB-INF\flex) and enable the use of mappings on your coldfusion instance. By default Flex is not allowed to use mappings in locating a cfc instance.

<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>

what you see is the default. Change the use-mappings key to true and your mappings will now work.

Ryan Guill
did you try this out and see if it worked for you?
Ryan Guill
Thanks, this solved the issue I was having.
Sly_cardinal