cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with cosuming data from backend.

Former Member
0 Kudos

I have successfully performed a GET request using POSTMAN CLIENT to obtain response from backend.This I have done through the port80 of the Reverse Proxy(Apache). I have followed all the steps given in the following link:-

Now I am trying to check whether I can consume the service using SAPUI5. But I am facing the following errors.Please help.The code snippet is also given below:-

In the screenshot the error along with the code snippet is attached.Also attached is the response obtained via postman client.

So here also I am just trying to get the response and then display it.But I am facing the mentioned errors.Please help.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184867
Active Contributor
0 Kudos

This seems to be a 'Same Origin Policy' issue.

There are many threads available in SAP UI5 forum on this issue.

you can disable web security in Chrome  and try it once.

javascript - Disable same origin policy in Chrome - Stack Overflow

Former Member
0 Kudos

Hi Atanu,

Thanks for the help.I went through the link and then opened cmd and moved into the folder where chrome.exe is and tried to disable web security.

C:\Program Files (x86)\Google\Chrome\Application>chrome.exe --disable-web-security

and then tried to run the program,but I am still facing the same issue.I am unable to understand how this metadata tag is getting appended with the url.

Please help.Also find attached the error screenshot.

former_member184867
Active Contributor
0 Kudos

The metadata is added by the framework. When you create a model the framework fires a call for metadata , this is perfectly fine.

Now it looks like, the same origin issue is solved. Now you can see 'GET' calls instead of "OPTIONS" (as per your last screenshot)

To check the current error, expand the error in Chrome debugger by clicking on the small triangle on the left

EkanshCapgemini
Active Contributor
0 Kudos

Hi Hirak,

As per screenshot 'success with postman', product is your entityset and the call on model creation is going to '.product/$metadata' which is not the correct URI for getting the metadata. Metadata is related to the service root, not to the entityset.

Regards,

Ekansh

Former Member
0 Kudos

Hi Ekansh,

Thanks for the reply.Unfortunately I am not clearly able to understand your point.
Yes as per the screenshot "success with postman" the entity set is productSet.

and here .product is the application id created in SMP Server.

Could you please be a bit elaborate.Thanks in advance.

Former Member
0 Kudos

Hi Atanu,

Yes that is correct.Please find the screenshots of the errors .I have followed the steps you mentioned.

former_member184867
Active Contributor
0 Kudos

May be the URL is not valid. Try to open the the complete URL(including metadata ) in browser.

Please ensure you have entered the Correct url(only the service document ) in OData Model creation in UI5.

EkanshCapgemini
Active Contributor
0 Kudos

Hi Hirak,

I also wanted to say the same thing as Atanu mentioned, the URL for getting the metadata is not looking like the valid URL for metadata.

Former Member
0 Kudos

Hi Atanu/Ekansh,

If i try to hit the url thorugh browser then I get the error Application id is not provided,which is correct.
So can you all tell me how to attach headers with url in browser.

I also tried to use the   http://services.odata.org/V3/Northwind/Northwind.svc  url but found the same issues.

I modified my code and the snapshot is attached .But I am facing other issues now.Please help.

Answers (0)