B4J Question Connect to jRDC2 via HTTP (NodeJS)

cheveguerra

Member
Licensed User
Longtime User
Hi everybody,

I have some apps (b4a) that use DBRequestManager to connect to an Oracle database and everything is working right, and I am also experimenting with a WhatsApp Bot and I need for the bot to connect to the same database, the bot runs on NodeJS and although it is possible to connect directly to the Oracle server, I would like to avoid that kind of connection (for security reasons), so the question is ... is it possible to connect to the jRDC server via an HTTP request??

NodeJS (Javascript) has "axios" and fetch and post, so, it is possible to make an http request to the jRDC server, but I dont know the headers required, and it seems that the parameters of the request need to be serialized for jRDC2 and something different for jRDC1.

So, does anybody have any idea if this can be done?

Best regards
 

cheveguerra

Member
Licensed User
Longtime User
jRDC1 is irrelevant. Don't use it.

jRDC2 uses B4XSerializator which isn't supported by NodeJS. You can add another handler to jRDC2 that produces a Json response instead of the binary response.
So... modify the server and just use Json on the bot's side.

Thanks @Erel

Best regards
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Alternatively, you can try my Pakai project template or EndsMeet server.
They support JSON and XML content type response.
 
Upvote 0

cheveguerra

Member
Licensed User
Longtime User
Alternatively, you can try my Pakai project template or EndsMeet server.
They support JSON and XML content type response.
Is there somewhere a description of the project?

Because

Version: 5.00

Create REST API Backend using B4J project template


is not all that descriptive 🤔

Best regards
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Is there somewhere a description of the project?

Because

Version: 5.00

Create REST API Backend using B4J project template


is not all that descriptive 🤔

Best regards
It's a project template. You use it like an additional library but start by creating a new project.
For tutorial, check this link:

If you don't need the web frontend, you can try this project:
 
Last edited:
Upvote 0
Top