Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to get the result of a GET request "splitted" with REST API

Hello,

I created a java application to make GET requests with REST API.
It works for small results, but if the XML page returned is too big, the connection is lost and i get only a small part of the data I need.

The url I'm using is something like this:

https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:results
I thought that if i were able to get the data I need in distinct pages, i could get them all without problems.
So I made some research and discovered that it is actually possible to split the page, but I none of the solution given worked for me.

So my question is: how can I get the data splitted in different pages, so i can navigate them and get all the datas?

0 votes



2 answers

Permanent link
have you tried the Resource Paging as mentioned in :

Resource Paging section of
http://open-services.net/bin/view/Main/OslcCoreSpecification?sortcol=table;up=#Query_Capabilities

here is an extract from the above link :

Another solution is to use Resource Paging; here's how it works. To get a paged version of a resource, a client adds the "key=value" pair oslc.paging=true to the query component of the resource URI and the server MAY respond by returning a representation that contains partial information about the resource; only a subset of the resource's property values.

When a page is returned and it is NOT the last page in the sequence, then it SHOULD include an oslc:ResponseInfo (defined below), which that contains a resource-valued property oslc:nextPage that links to a resource that represents the next page of property-values. Because paging is unstable (see below), by the time a client follows an oslc:nextPage link there may no longe be a next page, in this case the server MAY respond with an HTTP 404 Page Not Found status code.

A client can also request paging by adding the "key=value" pair oslc.pageSize to the query string component of the resource URI. By adding this, a client requests that the server respond with a specific number of property values. For example, oslc.pageSize=20 indicates to the server that the client would like 20 values per page. OSLC Services MAY ignore oslc.pageSize

hope it helps.

0 votes


Permanent link
I tried that too, but is seems to do not work. I don't know exactly how to make queries or set parameters in this URL.

I tried some URLs but the server just ignores them and tries to give me the whole page. I'm currently testing it on my browser, but my java app does not work.

I tried these:

https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:results?oslc.paging=true&oslc.pageSize=5&_startIndex=0
https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:results?oslc.paging=true

https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:results?oslc.paging=true&oslc.pageSize=10

https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:results?paging=true&pageSize=5



Am I missing something or writing the URLs the wrong way?

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,014

Question asked: Jun 23 '14, 3:18 a.m.

Question was seen: 5,252 times

Last updated: Jun 23 '14, 8:54 a.m.

Confirmation Cancel Confirm