Input parameters as matrix parameters

Previous Next

You can create a custom REST service method with input parameters that are passed as matrix parameters. In the following URL, 'booking_id=154' is a matrix parameter:

http://localhost:8090/mycustomservice/ActiveBookings;booking_id=154

 

To make this work, In Service Definer, the Relative URI Path field of the method must be:

/ActiveBookings

 

and you need to have an input parameter with the Annotation field set to:

@MatrixParam("booking_id")

 

You can then use the value of the parameter in the implementation of the method.

Multiple input parameters

If the method has more than 1 input parameter, the caller separates matrix parameters by using semi-colons (;) :

http://localhost:8090/mycustomservice/ListedTours;destination=HOLLAND;tour_type=TULIPS

 

In Service Definer, have multiple parameter records for the method, and make sure that each has an Annotation using the @MatrixParam keyword.

 

See also

Input parameters

Input parameters in the URL path

Input parameters in the URL query string

Input parameters as HTTP headers