我有 2 种具有相同 uri 参数的方法,如下所示,根据标准区分它的最佳方法是什么。(目前我收到一条错误消息,因为“每个操作都需要 UriTemplate 和 Method 的唯一组合才能明确地发送消息”)
uri 1:参数:“/PortalId/{PortalId}/ProjectId/{ProjectId}”;调用方法:GetProjectInfo
[OperationContract]
[WebInvoke(Method = "GET", BodyStyle= MessageBodyStyle.Bare,UriTemplate
="/PortalId/{PortalId}/ProjectId/{ProjectId}",
ResponseFormat = WebMessageFormat.Json)]
List<SurveyProjects> GetProjectInfo(String PortalId, String ProjectId);
uri 2:参数:“/PortalId/{PortalId}/ProjectId/{ProjectId}”;调用方法:GetQuestionsByProjectId
[OperationContract]
[WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, UriTemplate
="/PortalId/{PortalId}/ProjectId/{ProjectId}",
ResponseFormat = WebMessageFormat.Json)]
QuestionContainer GetQuestionsByProjectId(String PortalId, String ProjectId);