Creating REST Service Methods

You can create REST service methods only for a JadeRestService subclass. For details about defining a JADE method, see "Defining and Compiling JADE Methods and Conditions", in Chapter 4 of the JADE Development Environment User’s Guide.

The following subsections contain examples of REST service methods to handle GET, POST, PUT, and DELETE requests, which could be defined in a JadeRestService subclass in your schema.

The output parameter type is not appropriate for a REST service method and should not be specified. A method with this parameter type will cause exception 11103 (A parameter of the called method is usage output)at run time.

A parameter with the Any type is initialized to the string value from the URL.

A method return type of Any is encoded according to the type of data returned. If the returned value is an unassigned Any, exception 11111 (Unrecognised response from Rest service exception) is raised because the XML or JSON type is unknown.

When manually testing JADE REST service methods, the REST service is initialized if it has not been already, except if the application is already attached to a JADE Web Service Manager, in which case exception 11126 (A Rest Service method was called but the service was never initialised) is raised. In addition, if the JadeRestService class reply method is called and its processing is not associated with a received web message, exception 11127 (JadeRestServices.reply was called but there is no web message to reply to) is raised. To avoid exception 11127 when manually testing REST service processing, you should re‑implement the reply method on the JadeRestService subclass that is being used, and ensure that the reply method does not call inheritMethod.

A method called as the end point of a REST service request cannot be a type method (that is, it must be an instance method).

If access is protected or read‑only of a property of an input object to a REST service call, REST does not set the property.