【发布时间】:2011-04-18 20:11:45
【问题描述】:
考虑以下服务合同:
[WebGet(UriTemplate = "/stores")]
DTO.Stores GetAllStores();
[WebGet(UriTemplate = "/stores/{name}")]
DTO.Stores GetStores(string name);
我可以访问这两个网址:http://localhost/v1/stores 和 http://localhost/v1/stores/Joe。但是,Url http://localhost/v1/stores/(请注意末尾的斜杠)返回“未找到端点”错误。理想情况下,我希望http://localhost/v1/stores/ 调用 GetAllStores()。
我该怎么做?谢谢!
【问题讨论】:
标签: asp.net wcf asp.net-mvc-routing