In WCF can I have a wildcard character in a literal segment of my UriTemplate?
问题 I am authoring a RESTful WCF service using .Net 4.0. I want the following two URLS: /root/document/{ids}?fields={fields} /root/externaldocument/{ids}?fields={fields} to map to the same interface member: Documents GetDocuments(string ids, string fields) I have tried putting a wildcard into a literal URL segment: [OperationContract] [WebGet(UriTemplate = "/root/*document/{ids}?fields={fields}")] Documents GetDocuments(string ids, string fields) However, this is not valid and I get the following