使用 OData4j 的服务驱动程序分页
使用 OData4j 作为客户端时,是否可以在 WCF 数据服务中使用服务驱动的分页功能?使用服务驱动程序分页,即使客户端没有明确请求,服务器上的结果数量也会减少。当服务器应答时,应答仅包含 WCF 数据服务配置部分中配置的结果以及指向下一个结果集的链接。我想在 Java 端使用此功能。
服务驱动器分页信息的链接:
http://msdn.microsoft.com /en-us/library/ee473424.aspx
问题:
我的问题是,对于某些实体,服务驱动的分页似乎正在工作。对于其他一些实体,ODATA4j 客户端在结果期间迭代时始终发送相同的skiptoken(iterator.hasNext()),因此这是一种永远不会结束的循环,因为 WCF 数据服务一次又一次返回结果(这是正确的)从它的角度来看,因为有人一次又一次地使用相同的skiptoken请求数据)。当我在 Internet Explorer 中显示查询结果时,WCF 数据服务似乎提供了一个skiptoken。当我显示查询结果时,包括。这个skiptoken,我得到另一个skiptoken等,所以WCF似乎工作正常。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该透明地支持分页。这听起来像是特定于您的设置的内容 - 您可以打开客户端请求/响应日志记录 [1] 并将结果发送到 odata4j 讨论组 [2] 进行进一步调试吗?
希望有帮助,
- 约翰
[1] ODataConsumer.dump.all(true);
[2] http://groups.google.com/group/odata4j-discuss
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