SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
251 stars 73 forks source link

Server not callign JS Function #197

Closed danielloscheck2 closed 3 years ago

danielloscheck2 commented 3 years ago

Hello, I'm using the Server feature that is in the documentation. I was able to make the connection and expose the server.

But after that I called the RFC and for some reason my JS function is not being called.

Here's an exemple of my code:

const addon = require("node-rfc");
const Server = addon.Server;
const server = new Server({ dest: "gateway" }, { dest: "client" });

const my_stfc_connection = (request_context, abap_parameters) => {
    console.log("NodeJS stfc invoked ", request_context);
    console.log("abap_parameters  ", abap_parameters);
    return { };
}

server.start((err) => {
    if (err) return console.error("error:", err);
    console.log(
        `Server alive: ${server.alive} client handle: ${server.client_connection} server handle: ${server.server_connection}`
    );

    const RFM_NAME = "RFCTEST";
    server.addFunction(RFM_NAME, my_stfc_connection, (err) => {
        if (err) return console.error(`error adding ${RFM_NAME}: ${err}`);
    });
});

setTimeout(function () {
    console.log("bye!");
}, 20 * 100000);

This is the output after starting the server and calling the RFC: Server alive: true client handle: server handle: Metadata lookup for: RFCTEST genericHandler for: RFCTEST func_handle: found func_desc

My console.log 'NodeJS stfc invoked' never appears.

Any ideas?

Tks

bsrdjan commented 3 years ago

Sorry, the Server is only for internal experimenting and not available yet.

KunalBurangi commented 1 year ago

Is it available now? @bsrdjan

bsrdjan commented 1 year ago

Sorry, it is not available see https://github.com/SAP/node-rfc/issues/209#issuecomment-1262172717