Skip to Content
2
Sep 08, 2020 at 02:50 PM

CAP service (OData V2), Cloud Foundry Mobile Services and Kapsel plugins

365 Views

Hi all,

Unusual problem that I'd be very grateful if someone could answer or has any ideas on. To summarise:

I have a UI5 application which runs in the Cloud Foundry (CF) Fiori Launchpad and uses CAP for the backend. I'm using the OData v2 proxy adapter to provide an OData v2 service and have exposed that through my approuter. The OData v4 service is not mapped and is thus not available. I am also using CF mobile services to have an android version of this same app and it is using the kapsel plugins.

Now for the problem (I apologise it is a bit long):

Essentially my problem is that if I tick the option in Mobile Services offline odata configuration "Batch all defining requests" then when I run the application on android device, it fails to create the offline store. What's interesting though is that the error message (below) is returning HTTP 200 (success) and is actually returning the data from the service, however it is the OData v4 format which presumably is what is causing the crash. If I disable the "batch all defining requests" option then everything works as expected, so for some reason it is the batching that is causing the problem. In the FLP version of the app I am using batching without any issues, so it is not that my service doesn't support batching. My current thoughts are that something somewhere along the line is causing the OData v2 proxy adapter to crash or fail, and it is falling back to just returning the original OData v4 service. That is the only way I can think that the OData v4 service would be coming from the route, because as previously mentioned I have configured it such that it should technically be impossible to access through the app router.

Any thoughts or ideas would be very welcome

The error message is below and as you can see it is OData v4, I have clipped it after the first entity because it is a very long error message and you get the idea:

Retrieve feed https://<hidden>.cfapps.eu10.hana.ondemand.com:443/<hidden>/$batch failed because the OData server returned HTTP code, 200, with message: {"d":{"responses":[{"status":200,"id":"~00","headers":{"odata-version":"4.0","content-type":"application/json;odata.metadata=minimal;charset=utf-8"},"body":{"@odata.context":"$metadata#ExampleTypes","value":[{"ID":1,"name":"Example Data"}]}}
...