3

我是一名希望打入 Flex 的 ColdFusion 开发人员。我有几个正在测试的 Flex 应用程序,但在连接到我的 CFC 时遇到问题。我试过了:

  • 在 CFAdmin 中创建映射,
  • 将 CFC 与 Flex 应用程序放在同一文件夹中,
  • 将 CFC 放在 C:\Coldfusion8\Gateway\CFC 文件夹中,

一切都无济于事。

每次,我都会收到“找不到 ColdFusion 组件或接口”错误。我错过了什么?

下面是我如何调用 CFC 以供 Flex 使用。

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

3 回答 3

2

您还可以进入您的 remoting-config.xml 文件 ([coldfusionRoot]wwwroot\WEB-INF\flex) 并在您的冷融合实例上启用映射。默认情况下,不允许 Flex 使用映射来定位 cfc 实例。

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

你看到的是默认的。将 use-mappings 键更改为 true,您的映射现在就可以工作了。

于 2009-04-21T17:26:25.997 回答
0

我在某些服务器上遇到了类似的问题。我认为这与您网站上的安全设置方式有关。我最终采取了简单的方法,使我的 CFC 方法可以远程访问,并将它们称为 WebServices。

于 2009-04-21T14:25:45.650 回答
0

C:\Coldfusion8\wwwroot\Gateway\CFC 是正确的文件夹,而 cfc.bulkmail 是正确的来源。

它有效,我一定是在某个时候没有合适的案例。

但是,对于将来遇到同样问题的任何人来说,这都是答案。

于 2009-04-21T14:32:23.433 回答