Just throwing this out as a possibility...I have never done this and have no clue about performance, limitations, or complexity in troubleshooting.
Would it be possible to create a *stored procedure* that calls the desired ILE program? I know stored procedures can call ILE programs. I've seen other people do it in our shop.
Then, use IWS to create a single REST service (SQL type service). The REST service would contain two methods within it.
(1.) One method receives HTTP GET requests and executes the SQL statement against the database file or table (e.g., SELECT * FROM MYFILE).
(2.) A second method receives HTTP POST requests and executes a SQL CALL statement to call the stored procedure--which in turn calls the desired ILE program.
Thanks,
Kelly Cookson
Senior Software Engineer II
Dot Foods, Inc.
1-217-773-4486 ext. 12676
www.dotfoods.com
-----Original Message-----
From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Nadir Amra
Sent: Tuesday, November 17, 2020 1:40 PM
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: [WEB400] Mixing sql and service program in IWS...
Rob, no you cannot. But if you use an HTTP server you can always play with URL mapping so from the point of view of clients it does look like it is the same resource. In admin and programming guide there is some examples of URL mapping, although not related to this issue but would be a solution to what you want to achieve.
"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 11/17/2020 09:11:39
AM:
From: Robert Rogerson <rogersonra@xxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxxxxxxxx>
Date: 11/17/2020 09:12 AM
Subject: [EXTERNAL] Re: [WEB400] Mixing sql and service program in
IWS...
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>
Thanks Nadir, but I guess I wasn't clear in my question.
From what you said I create two web services students_srvpgm and
students_sql
Is there a way to do this so that the resource /students is used by
both?
So as i mentioned above (GET) /students executes a (SELECT *) SQL
statement
(web service students_sql)
and (POST) /students to call an RPG service program (web service
students_srvpgm)
I guess what I'm trying to ask is can two web services point to the
same resource (/students) and if so how do I do it.
I tried creating the sql web service but I got an error saying that
the resource /students already existed.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://urldefense.com/v3/__https://lists.midrange.com/mailman/listinfo/web400__;!!BZnD2a2Aqg!SfK5BgdRdszcdAWDqfCEV35bm-jNxYh5c_VxnlWHJNgHx6Zwhn8cqol1g2TUIA5J3Q$
or email: WEB400-request@xxxxxxxxxxxxxxxxxx Before posting, please take a moment to review the archives at
https://urldefense.com/v3/__https://archive.midrange.com/web400__;!!BZnD2a2Aqg!SfK5BgdRdszcdAWDqfCEV35bm-jNxYh5c_VxnlWHJNgHx6Zwhn8cqol1g2Q1UZ2ANQ$ .
As an Amazon Associate we earn from qualifying purchases.