Skip to Content

OData Offline Delta Download (Refresh)

Hello community,

I am using the Syclo Exchange framework to detect changes in my backend and enabled my OData Service to make use of it via delta tokens. If I send a delta token to my backend it is working fine and I only get the changed entities.

I use the following defining query:

"definingRequests": {
  'Notifs': "/notifications?$filter=applicationId eq 'QA'"
}

If I call this query in SAP Gateway client a delta token is returned:

I would expect now, that the store.refresh() method uses this delta token as the default value of "track_deltas" is set to "AUTO". But the mobile services is not using this delta token:

(Network trace of the refresh method). The first request is the definig query and the second request is the call of store.refresh().

The Log in mobile sservices is shwoing this:

Has anybody an idea, why my delta tokens are not working?

PS: I am using the Kapsel plugins in the newest version 4.2.7. and the android SDK as well, both with the same result.

Best regards,

Chris

Add comment
10|10000 characters needed characters exceeded

  • Its difficult to tell just looking at the screenshots. The network trace presumably shows both the initial request as a result of the initial download and the subsequent request as the result of a subsequent download, but there is no response shown. The server log presumably only shows the either initial download process or the subsequent download process (I suspect the latter), I don't see evidence of two download requests taking place. I suspect the best approach would be to file a BCP ticket and attach the complete files so we can investigate more thoroughly.

    One possibility, given that you are using Gateway, is that you have configured it, either explicitly or by accepting a default, to send the requests via JSON. Gateway does not support delta tokens with JSON, it will only send back delta tokens via XML.

  • Thanks again for helping. What is a "BCP" ticket? Do you want me to pass a full trace file here?

    How can I see if the initial request and the initial download is passed as JSON or XML to SCP? If I call a reuqest in SAP Gateway Client without passing a $format the default is XML and not JSON.

    Best Regards,

    Chris

  • Christoffer Fuss

    David suggested you to raise an OSS ticket to SAP support.

    Regards

    JK (Moderator)

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 02 at 06:31 AM

    I was able to fix the problem by myself.The problem was, that the offline store defining requests and refresh requests are sending the data in JSON format by default.The SAP Gateway is not able to send the delta token in JSON format, only in XML. To solve this I added the following custom headers to the offline store properties:

    "customHeaders": {
       "Content-Type" : "application/xml",
       "accept": "application/xml"
    }
    
    
    Add comment
    10|10000 characters needed characters exceeded