Introduction: What is $skiptoken?

When working with OData services, a developer might use the $top and $skip commands so that the client application can control paging.

However, some client applications might be coded inefficiently or even with malicious intent, so you might like to enforce Server Side Paging supported by the OData protocol. This means that the server does not return all results at once, but only a subset or “page” of all results.

If you choose to implement this, the client usually needs to know how many results there as a whole. To find this out, you can append the $inlinecount option to your query, like this:

5.Specify your required wsdl file and choose the required query operation from the list of soap operations and click on finish

6. Right click on Query and select Define Custom Code

7. Select the script type as either JavaScript or Groovy script. In this example we chose to implement the custom code using JavaScript.

8. The skip token value has to be fetched from the OData request URI and this value must be sent to the web service operation as an input parameter. A hashmap must be created in the processRequestData function with the input parameters (skipTokenID, top, skip) that will be passed in the URI. These parameters must then be set to message body as follows:

In this example, the $skipToken value equals 101 which is the ProductID of the last product. $skipToken value = 2 means, you will get only 2 entries at a time. This returns the next two entries. In this operation, moreEntries gives the information, if there are some more entries still there or not.

10. Once the web service response is returned, the response includes the entries and information whether there exist some more entries. These entries have to be added in the result set in processResponseData function. Also, we need to set the next the $skipToken value using thefollowing code: