rest - Cannot add the most basic RESTful web service -
i'm on windows 2008 r2 (64-bit) using cf10 (64-bit) (developer edition?)
i trying implement basic tutorial: http://blogs.coldfusion.com/post.cfm/rest-support-in-coldfusion-part-i
i created new website through iis on port 8081 , added 2 files:
/index.cfm (in theory, since no application.cfc containing app vars needed, have skipped this)
<cfset s = "hello world!"> <cfoutput>#s#</cfoutput>
/restexample/helloworld.cfc
<cfcomponent rest="true" restpath="/hello"> <cffunction name="sayhello" access="remote" returntype="string" httpmethod="get"> <cfset res="hello world"> <cfreturn res> </cffunction> </cfcomponent>
in cf admin:
- root path:
c:/websites/test/restexample/
- service mapping:
example
i following error:
error registering rest service. please ensure have entered proper mapping , path. application example not initialized. reason: application not contain rest enabled cfcs. application not contain rest enabled cfcs.
a bit of system information:
server product coldfusion version 10,0,8,284032 tomcat version 7.0.23.0 edition developer serial number developer operating system windows server 2008 r2 os version 6.1 update level /c:/coldfusion10/cfusion/lib/updates/chf10000008.jar adobe driver version 4.1 (build 0001) jvm details java version 1.6.0_29 java vendor sun microsystems inc. java vendor url http://java.sun.com/ java home c:\coldfusion10\jre
not sure if it's configuration issue @ point? related previous question, , trying simplify isolate cause.
edit #1 able add simple restful service windows 7 64-bit / cf 10 (no updates) without issues. wonder if it's install corrupt or update corrupted it?
edit #2 reinstalled cf server , still gave me same issue.
edit #3
as per milanchandna's suggestions, followed these steps:
- created folder c:\websites\milanchandna
- created new website (milanchandna using apppool same name) in iis , used c:\websites\milanchandna root, running on port 8084
- created jakarta virtual directory (need this)
- added basic helloworld.cfc
- navigated helloworld.cfc success, no errors
- in cf admin, rest services, added following:
- root path: c:/websites/milanchandna/
- service mapping: example
- click add service
- get error: error registering rest service. please ensure have entered proper mapping , path. application example not initialized. reason: application not contain rest enabled cfcs. application not contain rest enabled cfcs.
helloworld.cfc:
<cfcomponent rest="true" restpath="/hello"> <cffunction name="sayhello" access="remote" returntype="string" httpmethod="get"> <cfset res="hello world"> <cfreturn res> </cffunction> </cfcomponent>
as basic example not working, suggest follow starting.
- create fresh new folder in iis webroot. should not inside folder being used cf rest.
- just put 1 simple rest cfc in folder , nothing else. cfc example given in problem description looks good, let's use that.
access cfc browser access cfm
eg:[http://mysite:8081/mypath_to_cfc/mycfc.cfc]
check if throws error. if does, there problem in cfc. if doesn't go.
- register folder rest application administrator.
Comments
Post a Comment