I’m trying to call this method of my .svc file:
[WebGet]
public List<Request> GetRequestFilteredForUser(string login, long? minDate, short? statut, int pageIndex, int pageSize)
{
/* ... */
}
With this url:
http://localhost/Service/DataService.svc/GetRequestFilteredForUser?login=‘ADM’&minDate=634448160000000000&statut=5&pageIndex=1&pageSize=99
I get the exception: Bad Request – Error in query syntax.
If I call without the ‘minDate’ param, all work fine:
http://localhost/Service/DataService.svc/GetRequestFilteredForUser?login=‘ADM’&statut=5&pageIndex=1&pageSize=99
What is the problem?
Thank you
A long (or Int64) literal in URL needs to be in the format ###L, so for example 64L. So just add a trailing ‘L’ to your value and it should work. See this table for more details:
http://www.odata.org/developers/protocols/overview#AbstractTypeSystem