Search code examples
wcf-data-servicesodata4j

Service Driver paging using OData4j


Is it possible to use the service driven paging feature in WCF Data services when using OData4j as a client?Using service driver paging the number of results will be reduced on the server even if the client does not explcitly requested it. When the server answers, the answer contains only as many results as configured in WCF Data Services configuration section and a link to the next result set. I want to use this functionality on Java side.

Link for service drive paging information:

http://msdn.microsoft.com/en-us/library/ee473424.aspx


Issue:
My problem is that for some entities the service driven paging seems to be working. For some other entities the ODATA4j client sends always the same skiptoken when iterating during the results(iterator.hasNext()), so it is a kind of loop which never ends because the WCF Data Services is returning results again and again (which is correct from its point of view because someone is requesting the data with the same skiptoken again and again). When I display the results of the query in Internet Explorer, the WCF Data Services seem to provide a skiptoken. When I display the results of the query incl. this skiptoken, I get another skiptoken etc., so WCF seems to be working fine.


Solution

  • Paging should be transparently supported. This sounds like something that is specific to your setup - can you turn on client-side request/response logging [1] and send the results to the odata4j discussion group [2] for further debugging?

    Hope that helps,
    - john

    [1] ODataConsumer.dump.all(true);
    [2] http://groups.google.com/group/odata4j-discuss