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:

  1. created folder c:\websites\milanchandna
  2. created new website (milanchandna using apppool same name) in iis , used c:\websites\milanchandna root, running on port 8084
  3. created jakarta virtual directory (need this)
  4. added basic helloworld.cfc
  5. navigated helloworld.cfc success, no errors
  6. in cf admin, rest services, added following:
  7. root path: c:/websites/milanchandna/
  8. service mapping: example
  9. click add service
  10. 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.

  1. create fresh new folder in iis webroot. should not inside folder being used cf rest.
  2. just put 1 simple rest cfc in folder , nothing else. cfc example given in problem description looks good, let's use that.
  3. access cfc browser access cfm

    eg:[http://mysite:8081/mypath_to_cfc/mycfc.cfc]

  4. check if throws error. if does, there problem in cfc. if doesn't go.

  5. register folder rest application administrator.

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -