Skip to Content

404 Error while accessing HANA Odata

Jun 15, 2017 at 10:34 PM


avatar image

I am creating an Odata Service using SAP HANA Studio and running into 404 - Not Found. I checked and XSEngine is running, I validated that by just using hostname, port and instance. I tried both HTTPS and HTTP and getting message that XSEngine is running, but when I am trying to call my test odata service I am getting 404 - Not Found message.


One point to note system I am working on is a multitenant DB.

Please let me know if you have any suggestions for troubleshooting.

10 |10000 characters needed characters left characters exceeded

Do you have an .xsapp and and .xsaccess file in your project? What is the value of property "exposed" in your .xsaccess file?

* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Deep Kripalsingh Tanwar Jun 26, 2017 at 07:19 PM

This issue can only be resolved once xsengine is configured on your multi-tenant system. HANA Admin team helped me with this and its working now.

10 |10000 characters needed characters left characters exceeded
Daniel Degraf
Jun 17, 2017 at 02:27 PM


Did you create an .xspp and .xsaccess file, to expose XS services?

Best regards


Show 5 Share
10 |10000 characters needed characters left characters exceeded

yes, the files exist. .xspp has no content. .xsaccess has

   "exposed" : true, 
   "authentication" : { "method" : "Form"},
   "prevent_xsrf" : true

Still the error appears on executing it. The issue is same with .XSJS too, which gives same error on execution.

proj1.jpg (24.5 kB)

@Daniel - Thank You so much for your reply. Yes I can see these files.


@Deep Did this solve the issue for you? for me the files are there but error still appear.


Damandeep Thakur - I am following it up with HANA Admin, they told me they will try and get it resolved in two days. I think its because of multi-tenant DB. We also have a HANA system set-up where this architecture is not used and from that system I am able to create and execute odata services.

I will share update/details if this issue is resolved in two days or less.


from your screenshot I assume that you've created an XS project in SAP HANA Studio.

1) Make sure that .xsapp exists:


2) Make sure that .xsaccess exists:

     "exposed" : true,        
     "authentication" : {"method": "Form" }

3) Create a xsjs or xsodata file. In my case its a xsjs file:

//**** Example for basic REQUEST RESPONSE handling
var paramName; var paramValue; var headerName; var headerValue; var contentType;
//Implementation of GET call
function handleGet() {
	// Retrieve data here and return results in JSON/other format 
	$.response.status = $.net.http.OK;
	 return {"myResult":" GET success"};
//Implementation of POST call
function handlePost() {
	var bodyStr = $.request.body ? $.request.body.asString() : undefined;
	if ( bodyStr === undefined ){
		 $.response.status = $.net.http.INTERNAL_SERVER_ERROR;
		 return {"myResult":"Missing BODY"};
	// Extract body insert data to DB and return results in JSON/other format
	$.response.status = $.net.http.CREATED;
    return {"myResult":"POST success"};

// Request process 
function processRequest(){
		try {
		    switch ( $.request.method ) {
		        //Handle your GET calls here
		        case $.net.http.GET:
		            //Handle your POST calls here
		        case $.net.http.POST:
		        //Handle your other methods: PUT, DELETE
		            $.response.status = $.net.http.METHOD_NOT_ALLOWED;
		            $.response.setBody("Wrong request method");		        
		    $.response.contentType = "application/json";	    
		} catch (e) {
		    $.response.setBody("Failed to execute action: " + e.toString());
// Call request processing  

4) The path in your XS project has to be added to your service path. I noticed from your screenshots, that you named your service ZPO.xsodata, but you try to access https://hostname:43<Instance>/odatatest/premise.xsodata
Make sure that you get the XS Engine is up and running message, when accessing https://hostname:43<Instance>/.

From my screenshot it is:


Hope that helps.

Best regards


xsproject.png (6.5 kB)
Frank Schuler
Jun 16, 2017 at 05:16 AM

Hello Deep,

Pease check your HTTP and HTTPS server ports in webdispatcher.ini:

Best regards


server-port.png (28.4 kB)
Show 3 Share
10 |10000 characters needed characters left characters exceeded

Where to see this file? I have the same issue. I am trying in HANA studio, not on Cloud Editor.


@Frank - Thank You for your reply. I did check and I am not able to see these values under Configuration tab of Admin Prospective. I will check with BASIS team tomorrow and will update comments if issue is fixed. Thank You once again.


@Frank - As its a multi-tenant DB I tried to explain this to our HANA Admin. They told me that its configured in SYSTEMDB

but when I am checking in DB (lets call it DB1) I am logged into I dont have webdispatcher.ini on that server.

I checked link access-to-multitenant-database and it seems a new wdisp/system_n is needed for DB1 in SYSTEMDB.

But only thing is I can access XSEngine page from DB1.

untitled.png (42.3 kB)