具有不同参数的多个方法WCF REST

具有不同参数的多个方法WCF REST,wcf,rest,parameters,uritemplate,Wcf,Rest,Parameters,Uritemplate,我的任务是使用WCF REST实现以下功能: Resource POST GET PUT DELETE /device Create new device List devices Bulk update devices Delete all devices 因此,本质上我希望使用相同的UriTemplate,但根据消息体中传递的参数,结果不同。我知道我在Uri中添加了上述参数,

我的任务是使用WCF REST实现以下功能:

Resource POST GET PUT DELETE /device Create new device List devices Bulk update devices Delete all devices 因此,本质上我希望使用相同的UriTemplate,但根据消息体中传递的参数,结果不同。我知道我在Uri中添加了上述参数,但这只是为了区分Uri

我得到的错误如下:

UriTemplateTable does not support multiple templates that have equivalent path as template '/v1/device/?device={device}' but have different query strings, where the query strings cannot all be disambiguated via literal values. See the documentation for UriTemplateTable for more detail.
我知道为什么我会收到这个错误。我想知道的是如何解决这个问题?我已经考虑过让一个函数使用有效的方法=“*”,但除了在函数中传递的参数外,我无法访问其他任何参数

如果有人知道这个问题的解决方案,或者说如果不知道,这是不可能的,那将非常非常感谢


编辑:我也知道现在无法在GET中传递复杂类型,但这是一个可以解决的问题。

在这种情况下,最好的解决方案可能是对所有4种方法使用完全相同的UriTemplate:

UriTemplate = "/v" + REST_API_VERSION + "/device/?device={device}&collectionQuery={collectionQuery}&devices={devices}"
然后,您可以在每种情况下检查必要的参数

然而,我还是不明白为什么这不会抛出模糊的异常

UriTemplate = "/v" + REST_API_VERSION + "/device/?device={device}&collectionQuery={collectionQuery}&devices={devices}"