Edit "Hello world"
Welcome to the first SOA service program.
Here under is the source code for the first service program. It's written in RPG-Free, but can be in RPG3/4, COBOL, C or JAVA, in fact-all the programming languages that resides on the iSeries/Series i/As400 can be used. This program is called from the service bus, and it produced a XML-document with one field inside. This module can - without any changes, be used by other programs as a service, it can be used as a webservice directly (you don't have to do anything else) or as we also want - To use it, to display some information in a browser (next class...)
RPG Free sourcecode |
|
*************** Beginning of data ************************************* |
0001.00 |
h/COPY QI2W,LATEST_H |
0002.00 |
d/COPY QI2W,LATEST_D |
0003.00 |
***************************************************************** |
0004.00 |
/free |
0005.00 |
PutXmlRcd('dsoData':'' |
0006.00 |
+xmlA('field01':'Hello World - ' + %char(%time()) ) |
0007.00 |
); |
0008.00 |
Return; |
|
****************** End of data **************************************** |
In the first example we just set up the program inside the service bus and call it. It is the most simple business process you can create. It produces a XML document called dsoData with one level called record, with one filed called field01, with the value of "Hello world - (timestamp)" -
CLICK HERE to testEdit Next class
We now want to use the same program to display information from the document in a browser
Go to
Class 2 - Hello Html