Click here to Skip to main content
15,886,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created the RESTful service and below is the code. I want to support different uri's for this method. Please suggest me how to do this.

Supported URL Patterns:

GET /[lCode]/Country/[cCode|All]/GeographicCode/[geographicCode]
GET /Country/[cCode|All]/GeographicCode/[geographicCode]
GET /Country?...
POST /Country
Below is the code for the method

[OperationContract]
[WebInvoke(ResponseFormat = WebMessageFormat.Xml, Method = "GET", UriTemplate = "/Country/?cCode={cCode}&" + "geographicCode={geographicCode}&" + "lCode={lCode}&iInactive={iInactive}")]
Response Country(string cCode, string geographicCode,
string lCode, string iInactive);
Posted

1 solution

You need to create another Contract for post operation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900