Connect to ODATA backend

Hello,
I have SAP (Hana Cloud CDS) OData backend, can I use it from AppGyver?
I have tried but no luck so far.
THis is the type of backed I’m talking about:

Define a Simple Data Model and OData Service with CDS (sap.com)

Thanks!
Miguel

1 Like

I found the issue. For oData v2 by default service returns atompub XML which AppGyver cannot decode.
The real issue is that AppGyver couldn’t recognize $format=json parameter as well.

For oData v4 though it’s working fine as it returns JSON by default.

@AppGuyver team: Could you please have a look how can we invoke OData v2?

I am sorry… There is some new findings on the issue. Earlier I reported that Northwind Odata v4 is working. Based on that I am now trying to consume a OData V4 created on SAP Cloud Platform. However for this the service is giving same CORS issue.
So, this works perfectly:
https://services.odata.org/V4/Northwind/Northwind.svc/Products

While this is giving CORS error:
https://scpnapractice-test-cf-demoapp-salesorderworkflow-srv.cfapps.sap.hana.ondemand.com/order-workflow/SOFlow

Error: TypeError: Failed to fetch. Does the server allow CORS?status: undefined

Resource settings for Get collection (GET)

Resource URL: https://scpnapractice-test-cf-demoapp-salesorderworkflow-srv.cfapps.sap.hana.ondemand.com
Relative path: /order-workflow/SOFlow

Finally fixed the issue. In SAP Cloud Platform I have now added cors in my express. That works.

1 Like

Hi Shibaji, I am facing the same CORS issue while connecting sap cloud paltform odata v4 service. Can you elaborate how you fixed this issue?

Hello Shibaji,

I am also trying to consume ES5 service via rest integration, bu tgetting Cors error. How can i resolve it. I am having one more doubt, how can I provide user ID and password while testing ES5 Odata service. Please share you experience resolving the issue.

I had the same CORS issue when integrating our SAP C4C (Cloud for Customer). I needed a proxy in order to use the c4codataapi (v2).

You can find my comment here:
https://blogs.sap.com/2021/09/15/build-your-app-in-minutes-using-the-appgyver-on-sap-business-technology-platform/comment-page-1/#comment-590309

I’ll also write a guide.