× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



here is where you intercept the result in XMLCGI

when status = RUN_CGI_OUTPUT;
// -----
// send header + end (LFLF)
respHead = 'Content-type: text/xml' + CRLF + CRLF + NULLTERM;
rn = writeIFS(1:%addr(respHead):strlen(%addr(respHead)));
// send return data
szOClob = strlen(pOClob);
rn = writeIFS(1:pOClob:szOClob);
status = RUN_CGI_FINISH;



On Fri, Jan 27, 2012 at 7:43 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>wrote:

Hi Richard,

To me RESTful is anything where I can pass a formatted URL with parms
of some sort and get data back in XML, JSON or whatever format I
desire.

I see what you're saying. I think what happens is some instructor,
trying to extol the benefits of REST, says something like:

RESTful simplifies, because you don't have to create a complex document,
you can just do this:

GET http://example.com/inventory/AF21C

And then the learner says something like "what about if I did something
like this? would that be restful?"

GET http://example.com/inventory.pgm?loc=AF21C

And the instructor might say... "ummm, sure, I guess so. As long as you
still identify the object the URL, and still use GET, POST, PUT, DELETE
as the verb."

GET http://example.com/inventory.pgm?loc=AF21C
PUT http://example.com/inventory.pgm?loc=AF21C
POST http://example.com/inventory.pgm?loc=AF21C
DELETE http://example.com/inventory.pgm?loc=AF21C

And then the learner might say "but, my software only supports GET/POST
because that's all that was in common use on the web for ages... so can
I do rest, then?"

And the instructor says "well, people work around this by adding by
adding the verb to the URL, so you could have"

GET http://example.com/inventory.pgm?loc=AF21C
POST http://example.com/inventory.pgm?loc=AF21C&verb=ADDTO
POST http://example.com/inventory.pgm?loc=AF21C&verb=REPLACE
POST http://example.com/inventory.pgm?loc=AF21C&verb=DELETE

This is technically not REST, it's a workaround due to software
limitations. But it's "close enough", right?

And now you, Richard, are saying that it's just one more small deviation
of naming the program and parameters in an XML document is okay, and
it's still REST.

GET

http://example.com/cgi-bin/xmlcgi.pgm?db2=*LOCAL&uid=scott&pwd=pasword&ipc=/tmp/inventory&ctl=*sbmjob&xmlin=
<...xmlfile
with program definitions, parameters, return types, etc....>

I mean... at what point does it cease being "close enough" to RESTful?

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





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.