Soap is a standard. It specifies how you should ask for the data, and how the data has to look when you return it. It also provides for discovery services.
Rest is a way of doing things. There isn't a standard. Rest is about simplifying the process down to basic transactions, and letting you decide how to request what you want, and how to return it.
IWS is IBM's application server that acts as middleware. It imposes its own requirements on the process. I haven't ever actually used IWS for production, but did play around with it a (long) while ago. At the time as I recall, Soap was the only option, and after playing around with it, it was overkill for what I needed.
Fundamentally web services are just the process of sending or requesting data via HTTP. The basic requests that browsers use to post forms and get data could even be considered Rest. Soap is like an envelope. You have to address it correctly, you have to put the stamp in the right place, etc.
Since there is no standard for Rest, there is no requirement that your Restful web service return XML or JSON. None of mine do. IWS however forces you to choose to return either JSON or XML. It also defines how it is going to pass your program (in this case the program created when you compile the module below and create a program out of it) the parameters it receives, and how your program is supposed to return the data. It is built by IBM. They understand RPGLE. They don't make you do the XML or JSON formatting. They handle all of that for you and let you use traditional RPGLE parameters.
We have two main products here. One is completely web based and is built using PHP and runs on cloud servers. The other one is built using RPGLE/CL/C. It's primary interface is still 5250, but we have a good portion of it available as a web based front end written in PHP. There are things that the 5250 application knows that the web application occasionally needs. I don't want to have to store the data on the web and create an interface to keep it updated, so I created web services running on the IBM i. At the simplest my web services stack is Apache web server -> PHP -> IBM i database tables. Simple requests like balances can be returned like that. A request has a few security parameters, and then an account number. The return is just the number. Something like 253.14. No XML or JSON involved. A complex service is Apache -> PHP -> SQL stored procedure -> RPG program.
-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: Monday, November 05, 2018 10:02 PM
To: Web Enabling the AS400 / iSeries
Subject: [WEB400] CNVRTTMP.RPGLE has no xml or json -
All the documentation I find about web services talks about SOAP and REST and XML & JSON. Yet the IBM-supplied example CNVRTTMP.RPGLE is just a regular program. What am I not understanding?
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.