Forniamo inoltre Servizi professionali di alto livello (certificati AWS Architect) per
- formare il team del cliente che poi opererà in autonomia o con il supporto dei nostri consulenti,
- creare ogni tipo di API e webservices per:
- collegare i database IBMi AS400 per connettersi a :
- AMAZON SELLER
- SAP
- JD Edwards
- Documentali
- WAS
- B2B
- B2C
- ...
Perchè creare webservice in RPG?
- RPG ha elevata capacità transazionale in quanto non usa ODBC come invece PHP, NodeJS o Java
- sono compilati e quidi molto performanti e sicuri
- per contro richiedono scrittura di molto codice, un esempio:
senza REST400 2650 righe di codice RPG da scrivere e testare
con REST400 46 righe
ESEMPIO WEBSERVICES IN RPG FREE CODE usando REST400
h decedit('0,')datedit(*dmy/) option(*nodebugio:*srcstmt)
h dftactgrp(*NO) ACTGRP(*caller)
/free
/copy qcopy,WSMOD
dcl-pi *N;
inputPar likeDs(WbInput) const;
pOut pointer;
lenOut int(10);
end-pi;
dcl-s len int(10);
dcl-s JsonRqs varchar(8000);
dcl-s jsonRsp sqlType(CLOB:20000) ccsid(1208);
dcl-s pageNumber int(10) inz(1);
dcl-s pageSize int(10) inz(2);
dcl-s offsetqry int(10) inz(0);
dcl-pr QCMDEXC extpgm;
*n char(6000) options(*varsize) const;
*n Packed(15:5) const;
end-pr;
JsonRqs = %trim(%str(inputPar.Data_p:inputPar.DataLen));
// Elaboro Input
EXEC SQL
SELECT COALESCE(pageNumber, 1), COALESCE(pageSize, 2)
INTO :pageNumber, :pageSize
FROM JSON_TABLE(TRIM(:inputPar.queryParm), 'lax $' COLUMNS (
pageNumber INTEGER PATH 'lax $.page_number',
pageSize INTEGER PATH 'lax $.page_size')
) AS t;
// Calcolo offset paginazione
offsetqry = (pageNumber -1) * pageSize;
exec sql
select json_object(
'input' VALUE TRIM(:inputPar.queryParm) format json,
'conteggio' VALUE count(*),
'data' VALUE json_arrayagg(
json_object(
'id' value pid,
'name' value name,
'description' value description,
'price' value price,
'promoprice' value promoprice))) into :jsonRsp
from ( select * from sample/product
limit :pageSize offset :offsetqry ) pp;
pOut=%addr(jsonRsp_Data);
lenOut =jsonRsp_Len;
*inlr = *on;
return;
con REST400 crei subito webservice senza alcuna limitazione scrivendo poche righe di RPG, non devi più proccuparti di :
- autenticazione
- CCSID
- parametri
- log
- configurazione istanza apache
- e molto altro
a tutta la complessità pensa REST400