Skip to content

Write your own handler

solutionexchange edited this page Jun 16, 2011 · 1 revision

Writing your Handler

  • Navigate to the 'rest' project and Content - Administer

  • Expand the tree and select the 'handlers' folder

  • create a folder for your handler

  • handlers work by convention not configuration so navigate into your handler and create one with the correct naming format [Handler Name]_[Version Number].xml. (All handlers start as XML and then are styled to JSON or other future syntaxes)

  • Below is a sample code with standard setup and tear down includes.

    <yourHandlerTag rest-root="true">
    <!-- add general handler support -->
    <rde-dm:include content="handler-support.xml" />
    <!-- begin your code logic -->

    <!-- end your code logic -->
    <rde-dm:include content="handler-catch.xml" />
    </yourHandlerTag>

  • Call your handler http://[Web Server Host]:[Web Server Port]/api/[Version Number]/[Handler Name].[format]

  • Great good start now build a Unit Tests for it!

Clone this wiki locally