Skip to Content
0

Calling an .xsjs service from an external Web Client

Jul 04, 2017 at 08:30 AM

90

avatar image
Former Member

Hey guys,
i am very new to the backend part in web development and especially to SAP HANA. I am trying to set up a Web App which has a HANA DB in the backend.

I want to request and send data between my Hana DB and my Web App via Services. Now i have created a .xsjs on my Hana Server by which i can put data in my Hana DB by calling a URL to the .xsjs followed by some parameters like:
....insert.xsjs?productID=2&size=xxl.
Now when i copy the URL in my Web Browser i have to authenticate and login to HANA first. After i login, the URL is calling and the parameters within the URL are written to my HANA DB table.

My question is now, how can i call the URL as a HTTP request inside of a client side Javascript file on my Web App?

When i try to call a simple $.Post(url) method i get following error:

"XMLHttpRequest cannot load. 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mysite.de' is therefore not allowed access."

I have added "Access-Control-Allow-Origin" : "http://mysite.de" to my .xsaccess file but it didnt help.

Sorry for my bad english.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Gowthami B Nov 07, 2017 at 12:44 PM
0

Hi Arduc

Have you found a fix for this?

Share
10 |10000 characters needed characters left characters exceeded