1 Reply Latest reply on Feb 9, 2010 2:05 PM by Jochem van Dieten

    Writing RESTful Web Services

    JennHysuick

      I sure hope I'm in the right spot for this, as I have run out of places to look for answers.

       

      I need to write a web service.  I can find all the information in the world on consuming RESTful webservices, but I need to write one in Coldfusion.  I have a service that will return JSON, but I don't know how to make them RESTful.

       

      We are using these services to communicate with a Rhosync Server, and that portion has already been written.  All I have to go on is how to test the call, and what data will be returned.  The test call I was given is:

       

      $ curl -i -H 'Accept: application/json' --user username:password 'http://coldfusionServer.domain.ca/appname/users/'

       

      Is there a specific location that the CFCs should be, or a setting I need to have in the CFAdministrator?

       

      Right now, I have gotten to the point that if I go to

       

      http://coldfusionServer.domain.ca/appname/services/user.cfc?method=remoteGetUser&uName=Jen n&pass=jenn

       

      I can get back the data I want.

       

      The CFC I have are simple queries, which return JSON data (I am getting the correct format back) - it's an array of structs.

       

      Any help - links, code examples, explanations of how simple (I Hope) it is to read in a RESTful call, and return JSON back, would be most appreciated.

       

      Thanks!

       

      Jenn