Click here to Skip to main content
Sign Up to vote bad
good
See more: C#WCF
Hi,
 
i'm writing a wcf service and try to hold my Uri clean. I want to fire a "GET"-method with different parameters like that:
/// <summary>
/// Gives back a(n) Address by its id
/// </summary>
/// <param name="Address_id">The _id of the Address</param>
/// <returns>A(n) Address</returns>
[OperationContract(Name = "GetAddressById")]
[WebInvoke(Method = "GET", UriTemplate = "/Address/?id={id}")]
Address GetAddressById(int id);
and like that:
/// <summary>
/// Gives back a(n) Address by its City
/// </summary>
/// <param name="Address.City">The City of the Address</param>
/// <returns>A list of Address(e)s</returns>
[OperationContract(Name = "GetAddressByCity")]
[WebInvoke(Method = "GET", UriTemplate = "/Address/?City={city}")]
List<Address> GetAddressByCity(string city);
When i try to start the host, it says that i am not able to do something like that. Is there any possibility to enable such "multi"-uri with different parameters?
Posted 3 Jan '13 - 4:14


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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 273
1 Sergey Alexandrovich Kryukov 208
2 Abhinav S 168
3 Abhishek Pant 145
4 Guirec Le Bars 120
0 Sergey Alexandrovich Kryukov 8,439
1 OriginalGriff 6,681
2 CPallini 3,553
3 Rohan Leuva 2,793
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid