Cannot register REST services

南楼画角 提交于 2019-12-25 07:49:43

问题


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

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.

My directory contains:

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

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

So what?

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


回答1:


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.



来源:https://stackoverflow.com/questions/14499275/cannot-register-rest-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!