Previous Page Arrow Next Page Arrow

11.7 Operation Template

An operation may have a $template URL. If so, a GET operation on the $template URL will return default values for the operation parameters. For example:

GET /sdata/myApp/myContract/-/products/$service/computeSimplePrice/$template


200 OK
Content-Type: application/atom+xml; type=entry
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="">
    <productComputeSimplePrice xmlns="">

This URL is useful if the operation is invoked via a form. It allows the SData consumer to easily fill the form with meaningful default values. In the example above, the consumer will use 1.0 as default value for the quantity field.

The service schema MUST advertise the presence of a $template URL on service operations. This is done by setting the sme:hasTemplate attribute to true on service operation elements. For example:

<xs:element name="productComputeSimplePrice" 
SData providers MAY support $template URLs on service operations. If so, they MUST advertise it with an sme:hasTemplate attribute in the schema.

Previous Page Arrow Next Page Arrow