Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse Like RFC Gateway Support? #185

Closed
andwehrm opened this issue Aug 31, 2022 · 3 comments
Closed

Eclipse Like RFC Gateway Support? #185

andwehrm opened this issue Aug 31, 2022 · 3 comments

Comments

@andwehrm
Copy link

andwehrm commented Aug 31, 2022

Great job on the project,

Sadly i am unable to use it for day to day development because my main dev server has blocked the ports for the webservices.
RFC Gateway port 3300 and sap gui 3200 are accessible to me, hence im able to use eclipse adt fine.

Is there any reason you didnt use the rfc gateway for connection just like eclipse?

if you have any technical insight on that im considering to fork the project to get an rfc gateway compatible version!

Edit: i found that https://github.com/SAP/node-rfc is probably the technical info i will need to make a sufficient fork

Edit 2:
i have tried out the node-rfc library and was indeed able to replicate the quicksearch function on the ADT service, looks like with a good amount of work the RFC Gateway could be used as an alternative to the webservice on your https://github.com/marcellourbani/abap-adt-api

const noderfc = require("node-rfc");

const client = new noderfc.Client({ dest: "HCM" });

(async () => {
    try {
        await client.open();

        const request_line = {
            METHOD: "GET",
            URI: "/sap/bc/adt/repository/informationsystem/search?operation=quickSearch&query=TEST&maxResults=50",
            VERSION: "HTTP/1.1"
        }

        const sadt_request = {
            REQUEST_LINE :  request_line,
            HEADER_FIELDS : [ { NAME: "Accept", VALUE: "application/xml" }  ],
            MESSAGE_BODY : new Buffer(2)
        };

        const result = await client.call("SADT_REST_RFC_ENDPOINT", {
            REQUEST : sadt_request,
        });

        console.log(result.RESPONSE.MESSAGE_BODY.toString());
    } catch (err) {
        console.error(err);
    }
})();
@marcellourbani
Copy link
Owner

I never tried it because depends on binaries with questionable licensing you have to install from your sapgui distribution (or at least it used to).
Might be possible to plug it in as an alternate transport for abap-adt-api.
If you're able to make it work I'll merge it, otherwise I'll try myself but don't hold your breath ;)

@andwehrm
Copy link
Author

so i tried to implement it into the extension directly, but it turned out the sapnwrfc sdk has some problems with electron / vscode extensions in particular: SAP/node-rfc#144

so instead i wrote a very simple expressjs server which exposes the RFC gateway to localhost to act just like the normal ADT Web Service.
Then all i need to do is enter localhost as the system parameter in the vscode extension and it works like a charm:

https://github.com/andwehrm/rfc-connector

btw, even the stateful operations work with this without having the plugin installed on my 7.40 System

the only problem im currently facing is that i only receive empty message bodies from the CDS checking "checkrun" api of the extension

@marcellourbani
Copy link
Owner

Great idea!
As for the cds API my money is on a bug in the extension / api library
I never do any cds, so I have little feedback on them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants