The objects returned by the method MUST BE of type or inherited type of core.tut.pori.http.Response or void if default Response is to be used
Note: Your web services MUST be thread-safe and re-entrant
The methods are mapped based on the method name (name()) and the accepted methods (acceptedMethods()).
The name-method pairs must be unique:
- for the a single method with a name NAME there can be methods GET and POST, or
- two separate methods can both have the name NAME if and only if their methods do not contain same method names (i.e. method 1 can have method name GET, and method 2 can have method name POST, but not GET)
- the method name does not have to be one specified in RFC2616 (or, as defined by the document) can be any valid String
Example 1:
\@HTTPServiceMethod(name="TEST", acceptedMethods={"GET"})
public Response function1( ... ){ ... }
\@HTTPServiceMethod(name="TEST",acceptedMethods={"POST"})
public Response function2( ... ){ ... }
- In this example, the calls for method TEST will be directed to function1 when HTTP GET is performed, and to function2 when HTTP POST is performed
- Note that function1 and function2 are separate functions, and will be treated as such, and can have different signatures (e.g. parameters)
Example 2:
\@HTTPServiceMethod(name="TEST", acceptedMethods={"GET","POST"})
public Response function1( ... ){ ... }
- In this example, the calls for method TEST with HTTP GET or HTTP POST will both be directed to function1
The method will be reachable in the path designated by the \@HTTPService annotation's name and this annotation's name, generally in the format /WebApplicationName/rest/SERVICE_NAME/METHOD_NAME