How to implement a custom handler for a CAP CDS Se...
source link: https://community.sap.com/t5/technology-q-a/how-to-implement-a-custom-handler-for-a-cap-cds-service-with-a-namespace/qaq-p/13677074
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
an hour ago
Hello,
I am implementing a CAP CDS Service in NodeJS. I would like to use a custom handler for the same.
Example: in the CAP CDS folder srv, I have following file
TestService.cds (Contents)
namespace test.ns.srv;
service TestService {
function testFunction() returns Integer;
How should the implementation in TestImplementation.js look? All examples show the service without a namespace and the handler looks like this
class TestService extends cds.ApplicationService {
........
this.on("testFunction", async (req) => { });
The above construct works perfectly fine when the TestService.cds definition does not have a namespace. But with namespace, CDS does not link the handler implementation with the service.
Thank you
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK