无法通过网站网址访问Coldfusion Rest服务 - Coldfusion

时间:2016-01-08 15:02:06

标签: rest iis coldfusion coldfusion-10

我的coldfusion版本是10并配置了iis。我已使用以下代码配置了Rest服务

<cfset restInitApplication(getDirectoryFromPath(getCurrentTemplatePath()), "myservicename") />

我在同一目录中的cfc看起来像那样

component restpath="test" rest="true" produces="application/json"
{
     remote array function getResult(
        required string tmpID restargsource="path",
        string startDate restargsource="query",
        string endDate restargsource="query"
    )
            httpmethod="GET"
            restpath="{tmpID}"
    {
        return arguments.tmpID;
    }

}

我正在尝试通过url访问其余服务,但它给了我404找不到错误。这是我尝试过的网址。

http://localhost:8500/rest/myservicename/test/10221
http://example.com/rest/myservicename/test/10221
http://127.0.0.1/rest/myservicename/test/10221

但这三个都不适合我。当我尝试从coldfusion管理员刷新服务时,它给了我以下错误。

Unable to refresh REST service.
 Application myservicename could not be initialized.
 Reason: The application does not contain any rest enabled CFCs.
 The application does not contain any rest enabled CFCs.

我已将cfc保存到iis的webroot,并通过coldfusion管理员更新休息服务的根路径。然后上面的错误消失了,得到了绿色消息&#39;服务器已成功更新&#39;。但仍无法通过任何网址访问。仍有404错误。谁能指出我在哪里做错了?或者帮我解决这个问题。

0 个答案:

没有答案
相关问题