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
567

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).

View Entire Topic
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.