Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XSA Issue With Retrieving ODATA - TINY WORLD Tutorial

Former Member
0 Likes
929

Unable to parse xsodata file for Tiny world tutorial. Can someone help here?

I'm able to build and run my application - I get "Hello World", but unable to read the data. The tables and models exist.

Here is my service - euro.xsodata

service {
  “tinyworld.tinydb::myview” as “euro” keys generate local “ID”;
}

mta.yaml - this builds and runs (node.js application)

ID: tinyworld
_schema-version: '2.1'
version: 0.0.1
modules:
 - name: tinydb
   type: hdb
   path: tinydb
   requires:
    - name: hdi_tinydb
 - name: tinyjs
   type: nodejs
   path: tinyjs
   requires:
   - name: tinydb
   - name: hdi_tinydb
   provides:
   - name: tinyjs_api
   properties:
    sevice_url: ${default-url}
 - name: tinyui
   type: html5
   path: tinyui
resources:
 - name: hdi_tinydb
   properties:
      hdi-container-name: ${service-name}
   type: com.sap.xs.hdi-containe

server.js

/*eslint no-console: 0, no-unused-vars: 0*/
"use strict";

var xsjs  = require("@sap/xsjs");
var xsenv = require("@sap/xsenv");
var port  = process.env.PORT || 3000;

let options = {
	anonymous : true, // remove to authenticate calls
	auditLog : { logToConsole: true }, // change to auditlog service for productive scenarios
	redirectUrl : "/index.xsjs"
};

// configure HANA
try {
	options = Object.assign(options, xsenv.getServices({ hana: {tag: "hana"} }));
	// options = xsjs.extend(options, xsenv.getServices({ hana: {tag: “hana”} }));
} catch (err) {
	console.log("[WARN]", err.message);
}

// configure UAA
try {
	options = Object.assign(options, xsenv.getServices({ uaa: {tag: "xsuaa"} }));
} catch (err) {
	console.log("[WARN]", err.message);
}

// start server
xsjs(options).listen(port);

console.log("Server listening on port %d", port);

error message

{error: 
{code: "500",
message: 
{lang: "en-US",
value: "Error while parsing xsodata file."
}
}
}
2 REPLIES 2
Read only

Former Member
0 Likes
715

I am also getting same issue. Is this issue resolved/. If yes can you please tell me what changes you made in code?

Read only

former_member331186
Discoverer
0 Likes
715

Hi,

I faced similar issue. Restarting the nodeJS module worked for me.

Regards,

Sayeeda