如何将Uri中的数组传递给WCF WEB API服务?

如何将Uri中的数组传递给WCF WEB API服务?,wcf,wcf-web-api,Wcf,Wcf Web Api,有没有一种方法可以使用GET将值数组传递给wcfwebapi服务?我想对我的服务进行以下呼叫: http://localhost/myservice.com/projects/workspaceUsers?token=A3AD62998A7A463A9AD23D8F2937C92220120325072846&workspaceId=208&workspaceId=209 我的web服务功能如下所示: [WebGet(UriTemplate = "workspaceUsers?

有没有一种方法可以使用GET将值数组传递给wcfwebapi服务?我想对我的服务进行以下呼叫:

http://localhost/myservice.com/projects/workspaceUsers?token=A3AD62998A7A463A9AD23D8F2937C92220120325072846&workspaceId=208&workspaceId=209
我的web服务功能如下所示:

[WebGet(UriTemplate = "workspaceUsers?token={token}&workspaceId={workspaceId}")]
    public HttpResponseMessage<IEnumerable<WorkspaceUserReadOnlyChildData>> FetchWorkspaceUserList(string token, int workspaceId)
有没有什么方法可以在不使用POST传递criteria对象的情况下做到这一点


谢谢你的帮助

我认为最简单的方法就是更新ASP.NET 4 WEB API。由于它在标准控制器体系结构之外运行,您可以轻松地传入数组。

为什么不尝试使用逗号分隔的值,而不是int数组。如果您使用的是ASP.NETMVC或新的WebAPI,那么您可以使用ModelBinderis,我发现这也是最好的解决方案。
The service operation 'FetchWorkspaceUserList' will never receive a value for the input parameter 'workspaceId' of type 'Int32[]'. Ensure that a request HttpOperationHandler has an output parameter with a type assignable to 'Int32[]'.