Again, just so everyone is on the same page, you can implement the URLs
listed by Rajesh.

So the POST may be a call to a stored procedure.

The /students may be handled by SQL statement select.

Same with the other URLs. If you deploy SQL web service students, the
template URLs for the

(PUT) /students/123
(GET) /students/123

would be /{id}

So when a user

/students with POST it will be directed to stored procedure call.

A (GET) /students

would result in SQL select procedure and so on.

The point is that you can do this using SQL APIs.


"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 11/17/2020 03:37:37
PM:

From: Rajesh Ravindran <rajesh.ravi@xxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxxxxxxxx>
Date: 11/17/2020 03:38 PM
Subject: [EXTERNAL] Re: [WEB400] Mixing sql and service program in
IWS...
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>

But that approach do not follow the REST API standards, as per REST
standards
(POST) /students - Creates new student
(GET) /students - Returns all students
(GET) /students/123 - Return student 123
(PUT) /students/123 - Update student 123

Rajesh

On Tue, Nov 17, 2020 at 4:19 PM Nadir Amra <amra@xxxxxxxxxx> wrote:

Just to clarify,using Kelly's method does not require URL to change.
GET
requests will be passed to "procedure" configured to handle GET
request,
and POST request will be handled by "procedure" configured to handle
POST
request. So the solution is viable.




"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 11/17/2020
02:08:02
PM:

From: Kelly Cookson <KCookson@xxxxxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxxxxxxxx>
Date: 11/17/2020 02:08 PM
Subject: Re: [WEB400] [EXTERNAL] Re: Mixing sql and service program
in
IWS...
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>

I should have clarified: this is not exactly what you requested,
since you will need to add the method names to the URL. I think what
you requested was a way to use a single URL, but have different code
executed within the REST service based on the HTTP used to request
something from the REST service. So https://
urldefense.proofpoint.com/v2/url?
u=http-3A__myUrl_students&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=1i-
jGlz0-JTK1aLHcsU-







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.