Re: Mixing sql and service program in IWS...

"Nadir Amra" <amra-r/[email protected]>
Newsgroups gmane.comp.systems.as400.web
Message-ID <OF10E4A441.48251770-ON00258623.0080C2ED-86258623.00815BDD@notes.na.collabserv.com>
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" <[email protected]> wrote on 11/17/2020 03:37:37 
PM:

> From: Rajesh Ravindran <[email protected]>
> To: "Web Enabling the IBM i (AS/400 and iSeries)" 
<[email protected]>
> Date: 11/17/2020 03:38 PM
> Subject: [EXTERNAL] Re: [WEB400] Mixing sql and service program in 
IWS...
> Sent by: "WEB400" <[email protected]>
> 
> 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-r/[email protected]> 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" <[email protected]> wrote on 11/17/2020 
02:08:02
> > PM:
> >
> > > From: Kelly Cookson <KCookson-EAwJ3jYHSpVWk0Htik3J/[email protected]>
> > > To: "Web Enabling the IBM i (AS/400 and iSeries)"
> > <[email protected]>
> > > Date: 11/17/2020 02:08 PM
> > > Subject: Re: [WEB400] [EXTERNAL] Re: Mixing sql and service program 
in
> > IWS...
> > > Sent by: "WEB400" <[email protected]>
> > >
> > > 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-
> > >
> >

> 


-- 
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.