WSQuery

Specifies parameters to be passed in the URL query string.

Syntax

WSQuery

This attribute supports a query in the URL. Zero, one, or several parameters can be specified.

WSQuery is an optional attribute.

Usage

You set the WSQuery attribute in an ATTRIBUTE() clause of an input parameter (only) of the function. Its use is suited to filtering on resource collections, such as /users/findByCountry?country=france. The client application needs to provide appropriate parameter values when making a call to the function.

Example WSQuery


PUBLIC FUNCTION getUsersByCountry(
     p_country STRING ATTRIBUTE(WSQuery) )
  ATTRIBUTES (WSGet, 
              WSPath="/users/findByCountry",
              WSDescription="Get users by country",
              WSThrows="400:Invalid,404:NotAvailable" )
  RETURNS ( DYNAMIC ARRAY OF userType )
  
    DEFINE countryList DYNAMIC ARRAY OF userType
      
    # ... function code  ...

    RETURN countryList
END FUNCTION
This function has a WSQuery parameter, which forms the query string of the URL ?country=france:
http://host:port/gas/ws/r/MyService/users/findByCountry?country=france