lyDefinition资源宁静WCF默认值
[OperationContract]
[WebGet(UriTemplate = "getbydaterange/{insId}/{startDate}/{endDate}", ResponseFormat = WebMessageFormat.Json)]
List<RestfulServiceObj> GetMyObjectsByDateRange(string insId, string startDate, string endDate);
的我怎样才能使最后的两个参数可选?即,我想底部的三个电话的工作
"http://domain.com/service.svc/myid/"
"http://domain.com/service.svc/myid/07-07-2011"
"http://domain.com/service.svc/myid/01-01-2011/07-08-2011"
但只有最后一次通话的作品,剩下的给缺少的参数错误。
感谢 看涨
什么是您的.NET framework版本? [我之前测试过](http://stackoverflow.com/questions/5781342/wcf-and-optional-parameters)用'UriTemplate'的查询字符串中的'string'和'int'参数,它工作。 –