I don't quite follow your question, Richard.

I couldn't use GETURI/HTTPAPI/YAJL for the project using RPG to make client
requests. There's no HTTP client interface endpoint (or at least a
published one). The only interface was using their SDKs. Yes, in the
background I'm sure they use HTTPS.

So I wrote it in NodeJS using their NodeJS SDK.

Pretty simple.


Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #17 <https://www.bvstools.com/mailtool.html>: Compatible
with Google/Gmail/G Suite, Outlook.com, Microsoft Office 365 as well as
most other SMTP servers and relays. No tricks, gimmicks or relays needed.
MAILTOOL is set up just like a PC or mobile device with the appropriate
outgoing mail router information and well as the proper authentication.

On Tue, Mar 20, 2018 at 12:12 PM, Richard Schoen <
Richard.Schoen@xxxxxxxxxxxxxxx> wrote:

So you connect with SSH and run Node scripts since you can use HTTP ?

Regards,

Richard Schoen
Director of Document Management
e. richard.schoen@xxxxxxxxxxxxxxx
p. 952.486.6802
w. helpsystems.com
----------------------------------------------------------------------

message: 1
date: Tue, 20 Mar 2018 09:55:12 -0500
from: Bradley Stone <bvstone@xxxxxxxxx>
subject: Re: [WEB400] [EXTERNAL] Re: Rise of Node

On Tue, Mar 20, 2018 at 9:23 AM, Nathan Andelin <nandelin@xxxxxxxxx>
wrote:

In the case of reading files from the local file system, Node.js
async-await adds 10-25 times to complete the read cycle in comparison
to synchronous processes written in Python. Imagine how much longer
that would take if a batch process were working against a remote
database which entails not only reading from a file system, but add to
that the requirements of inter-system communications.

To me, that would be a strong case for using RPG to implement batch
processes against IBM i databases as opposed to force-fitting that
into a Node.js service.


I agree, and in my case I normally would use RPG if it's an option. But,
sometimes it's not.

Example, as Aaron knows I am working on a project for a customer that uses
Braintree (which I will hold my tongue about their sandbox.. contact me
offline for a good laugh). He is too! A different customer though.

Anyhow, Braintree doesn't allow traditionally HTTP requests. They only
allow use of their SDKs, which are available in a host of languages, node
being one of them, and the one I chose to use (I love JS...)

Sure, I may be able to spend days parsing their requests, finding the
endpoints used in the SDKs, etc, and use RPG, but I decided to use this as
a real POC project for node. All my others weren't real production, just
samples. http://nodejs.bvstools.com:5250/

My customer really wanted me to use RPG (GETURI, YAJL, etc). Well, I
couldn't in this case.

So while there are instances where I wish things were sync, yes, I had to
"force" them. I was planning on putting node 8 on for the new promise
features but decided for now, I'll leave it as is.

I got the project done (still in testing) and learned a lot in the
process, some good, some bad, about the evolution of node and how we can
use it on the IBM i in real world cases.

One day when I can collect my thoughts and see how the process actually
performs ITRW I shall pen an article about my journey at fieldexit.com.

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.