Product Information > JADE Developer’s Reference > Chapter 11 - Building Web Services Applications > JadeRestService Class

JadeRestService Class

A transient instance of a subclass of a JadeRestService class is created by each REST services application and used by each REST services message that is received. The processRequest method is called on this object, passing the message details in the URL. The method decodes the URL and any objects passed in XML or JSON format, and calls the required method on the same JadeRestService object. The result returned by the method is encoded into XML or JSON, as requested. The reply method is then called, passing the string to be returned to the client.

The constants defined in the JadeRestService class are summarized in the following table.

Constant Integer Value
OutputFormat_Json 0
OutputFormat_Json_NewtonSoft 2
OutputFormat_Xml 1

The properties defined in the JadeRestService class are summarized in the following table.

Property Contains the …
httpStatusCode HTTP status code error returned to the client
objectsToBeDeleted Array for transient objects to be deleted when the REST method has completed

The methods defined in the JadeRestService class are summarized in the following table.

Method Description
getOutputFormat Returns an Integer value that represents the output format
getServerVariable Returns the specified HTTP header information for your REST service request from the Internet Information Server (IIS)
processRequest Processes the received message
reply Sends the returned value from the called method to the client

For details, see "JadeRestService Class", in Chapter 1 of the JADE Encyclopaedia of Classes.