无法注册REST服务 [英] Cannot register REST services

查看:110
本文介绍了无法注册REST服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I try to register a directory as a REST app in my CFIDE administrator:


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

Error registering REST service. Please ensure that you have entered a proper mapping and path. Application servizi could not be initialized. Reason: The application does not contain any rest enabled CFCs. The application does not contain any rest enabled CFCs.

我的目录包含:

Application.cfc

Application.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;
    }
}

Product.cfc

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

那又如何呢?

此外,该功能在一个月前还有效。会发生什么事?

In addition, this worked a month ago. What can be happened?

推荐答案

如果 skipCFCWithError 为真,并且仅存在CFC就有问题

可能您已经更改了该CFC中的某些内容,但现在无法正常工作。

尝试在浏览器中访问CFC,就像您访问任何CFC一样。 CFM。

这将告诉您CFC是否存在问题。

If skipCFCWithError is true and there is some problem in only CFC present in that directory then it shows this error.
Probably you might have changed something in this CFC and its not working now.
Try to access your CFC in browser just as you access any CFM.
That will tell you if there is a problem in your CFC or not.

如果存在问题,请修复并重试

If there is a problem then fix it and try again.

这篇关于无法注册REST服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆