1

我尝试在我的 CFIDE 管理员中将目录注册为 REST 应用程序:

注册 REST 服务时出错。请确保您输入了正确的映射和路径。无法初始化应用程序服务。原因:应用程序不包含任何启用了休息的 CFC。该应用程序不包含任何启用了 REST 的 CFC。

我的目录包含:

应用程序.cfc

component output="false"
{
    this.name = "otticanet-rest";
    this.applicationTimeout = createTimespan(0,1,0,0);
    this.datasource = "svvv";

    this.restsettings.skipCFCWithError = true;

    public boolean function onRequestStart()
    {       
        return true;
    }
}

产品.cfc

<cfcomponent rest="true" restpath="occhiali">

    <cffunction name="getByMarchioAndTipo"
                access="remote"
                httpmethod="GET"
                restpath="{idmarchio}/{idtipo}"
                returntype="Struct"
                produces="application/json">

        <cfargument name="marchio" required="true" restargsource="Path" type="numeric" />
        <cfargument name="tipo" required="true" restargsource="Path" type="numeric" />

        <cfreturn LOCAL.s />
    </cffunction>   
...

所以呢?

此外,这在一个月前有效。会发生什么?

4

1 回答 1

2

如果skipCFCWithError为真,并且该目录中仅存在 CFC 存在一些问题,则显示此错误。
可能您可能已经更改了此 CFC 中的某些内容,但它现在无法正常工作。
尝试在浏览器中访问您的 CFC,就像访问任何 CFM 一样。
这将告诉您 CFC 是否存在问题。

如果有问题,请修复它并重试。

于 2013-02-22T08:00:20.707 回答