on 06-15-2017 11:34 PM
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.
https://hostname:43<Instance>/odatatest/premise.xsodata.
One point to note system I am working on is a multitenant DB.
Please let me know if you have any suggestions for troubleshooting.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did you create an .xspp and .xsaccess file, to expose XS services?
Best regards
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
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:
$.response.setBody(JSON.stringify(handleGet()));
break;
//Handle your POST calls here
case $.net.http.POST:
$.response.setBody(JSON.stringify(handlePost()));
break;
//Handle your other methods: PUT, DELETE
default:
$.response.status = $.net.http.METHOD_NOT_ALLOWED;
$.response.setBody("Wrong request method");
break;
}
$.response.contentType = "application/json";
} catch (e) {
$.response.setBody("Failed to execute action: " + e.toString());
}
}
// Call request processing
processRequest();
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:
https://<host>:<port>/Test/<black>/TestXS/service.xsjs
Hope that helps.
Best regards
Daniel
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.