cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to load Northwind service in R/W mode for SAPUI5 App

avisheksharmacoder
Participant
0 Kudos
563

Hi, I am not able to load Northwind service in Read Write Access, using the V2 link.

I have used this link.

however, this is returning status as 500,

however, the service is working fine in the browser. (able to load metadata and records as well).

Accepted Solutions (1)

Accepted Solutions (1)

boghyon
Product and Topic Expert
Product and Topic Expert

The service you're referring to is not a "Northwind" service but a different service based on OData V3. The "sap.ui.model.odata.v2.ODataModel" class supports only the OData V2 standard.

The error code 5XX (e.g. 500 or 501) typically indicates a server error.

Generally, OData services from odata.org are poorly maintained, incomplete, and has many issues some of which I already reported: https://github.com/OData/ODataSamples/issues?q=is%3Aissue+author%3Aboghyon

Note that those services from odata.org don't support generating CSRF tokens. In that case, add tokenHandling: false when instantiating the v2.ODataModel:

new ODataModel({ // V2
  serviceUrl: "...",
  tokenHandling: false,
  // ...
})

Instead of the services from odata.org, take a look at https://blogs.sap.com/2017/12/05/new-sap-gateway-demo-system-available/ for other sample OData services from SAP.

avisheksharmacoder
Participant
0 Kudos

Hi, I have used V2 standard of the service.

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

avisheksharmacoder Hi, could you elaborate more? The data service itself is based on the OData V3 standard which cannot be changed. What do you mean by "I have used V2 version of the service"? And what is "this" in "how come this is still using a V3"?

avisheksharmacoder
Participant
0 Kudos

Hi, In the northwind service, when I opted for Full Access Read and Write, it returned this https://services.odata.org/V3/(S(45h3q0wgq4reb1h143jkve1l))/OData/OData.svc/

I changed the standard from V3 to V2, ran Products EntitySet and it worked fine. But on controller, it is returning the above mentioned error.

boghyon
Product and Topic Expert
Product and Topic Expert

avisheksharmacoder I just enhanced my answer.

avisheksharmacoder
Participant
0 Kudos

Yes, you are correct. This in fact is very poorly maintained. I still couldn't get a workaround. (With your current solution)

However, do you happen to know any other odata services alternative to this? Or I have to just create my own OData services from scratch from SAP system.

boghyon
Product and Topic Expert
Product and Topic Expert

avisheksharmacoder Yes, other OData services can be found in the blog post I mentioned in my answer. Let me know if it helps!

avisheksharmacoder
Participant
0 Kudos

Yes, thanks for the blogpost. I am able to read that in ui5 app. Thank you.

Answers (2)

Answers (2)

Shruthi29
Explorer
0 Kudos

Hi avisheksharmacoder,

As you are mentioning both Northwind and OData , not getting clarity,

Follow these links listed below you will get more clarity on Northwind.

https://youtu.be/IKHWNbMgttU

https://youtu.be/UsXRGve--Dw

Where OData services are of different: Look at this blog for reference:
https://blogs.sap.com/2023/07/03/step-by-step-process-to-create-odata-services-in-sap/

Thank You,
Shruthi.

avisheksharmacoder
Participant

Hi, here the implementation I have done is using Northwind's Odata V2 service. It seems to have worked for just READ ops but for R/W, I am getting errors.

Shruthi29
Explorer

Northwind only for Testing Purpose that too i worked on read operation only,
OData you can perform CRUD operations, based on your Scenario design,

Thank You.

AlexNecula
Active Contributor
0 Kudos

Hi,

Did you check the Network tab in the developer tools to see if the URL is correct? I see that you're using an absolute URL without specifying the domain. This means that it is probably trying to access the same domain as your app instead of Northwind.

Alex

avisheksharmacoder
Participant
0 Kudos

Yes, on the network tab, it appears as a red link. But I am using this link via Northwind destination from BTP, so shouldn't this link just work fine ? (Already did the same with general northwind link for read and it worked good).

AlexNecula
Active Contributor

Is there any error description in the response?

avisheksharmacoder
Participant
0 Kudos

Its saying uncaught in promise, but there is no specific status text, but statusCode is 500