1

I have this REST WCF service.

[WebInvoke(UriTemplate = "/GetNames/{Category}?order=asc", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] 
public List<Names> GetNames(string Category)
{
    //Code to retrieve Names by category.
}

The Category parameter is mapped to {Category} in the Uri.

But how can I map the order query string in the Uri to this method?

Adding the order as a parameter method is not working.

please help. thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Sidharth
  • 1,251
  • 1
  • 25
  • 40
  • 1
    If you post code, XML or data samples, **please** highlight those lines in the text editor and click on the "code samples" button ( `{ }` ) on the editor toolbar to nicely format and syntax highlight it! If you post error messages, **please** use the blockquotes ( ` " ` ) to properly format the error message. – marc_s Mar 25 '11 at 11:15

1 Answers1

2

Have you tried - "/GetNames/{Category}?order={ordering}" in the Uritemplate and in the function

public List<Names> GetNames(string Category, string ordering)
{
  //Code to retrieve Names by category.
}
user275157
  • 1,332
  • 4
  • 23
  • 45