3

I'm a ColdFusion developer looking to break into Flex. I have a couple test Flex applications Ii'm working on, but am having problem connecting to my CFCs. 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">
Shawn Holmes
  • 3,752
  • 22
  • 25
Gene R
  • 1,555
  • 5
  • 19
  • 32

3 Answers3

2

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
  • 13,558
  • 4
  • 37
  • 48
0

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
  • 10,574
  • 13
  • 75
  • 116
0

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
  • 1,555
  • 5
  • 19
  • 32