Skip to Content
0
Apr 29, 2020 at 06:53 AM

@sap/cds-odata-v2-adapter-proxy - problem with FunctionImport

369 Views

Hey Community,

I'm getting a warning in the @sap/cds-odata-v2-adapter-proxy console, when calling a function import. I'm getting a response, but it is about one minute delayed, which obviously makes the service useless in my app. Here is the console output of the proxy.

(node:29710) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'ID' of undefined

    at Object.keys.forEach.key (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:1283:42)

    at Array.forEach (<anonymous>)

    at data.forEach.data (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:1282:25)

    at Array.forEach (<anonymous>)

    at convertRequestData (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:1281:10)

    at convertRequestData (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:1274:14)

    at convertRequestBody (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:1265:7)

    at convertProxyRequest (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:492:16)

    at ProxyServer.onProxyReq (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/@sap/cds-odata-v2-adapter-proxy/lib/index.js:262:9)

    at ProxyServer.emit (/Users/simonroloff/git/kora-suite-cap/proxy/node_modules/eventemitter3/index.js:184:35)

(node:29710) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:29710) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is my ODATA2 Request (run in Postman)

http://localhost:4004/v2/odata/v4/NAVIGATE_SRV/GetHierarchy?Child='Test123'

And this is my service definition

	@cds.persistence.skip

	entity ChildSet{

		key Id: String;

		Keydate: String;

		Parent: String;

		Kind: String;

		Desc1: String;

		Desc2: String;

		Childrencount: Integer;

		Openplan: String;

		NextSeparator: String;

		WSApplications: String;

		Responsible: String;

		Redlining: String;

		ValidFrom: String;

		ValidTo: String;

	}

		

	@cds.persistence.skip

	function GetHierarchy(Child:String) returns array of ChildSet;

I'm using the latest version of the proxy:

"@sap/cds-odata-v2-adapter-proxy":"^1.4.29"

Thank you very much for helping me!

Simon