Edit

"Hello world" in in HTML

In the first - (Class 1 - Hello World) example we just set up the program inside the service bus and called it. produced a XML document, that were sent back to the browser and displayed. In effect you just called a webservice, that responded! Simple isn't it.


<?xml version="1.0" ?>
<xml id="dsoData">
<root>
<record>
<field01>
<Hello World - 2008-11-25-15.53>
</field01>
</record>
</root>
</xml>

As explained, we also want to use the service to display the information in the field (field01) in a browser. We want the text "Hello world" + a timestamp to se that we actually got the information online. We could just write the text inside the HTML, but we want the text to come from the same RPG program, to show that the same program is used for webservices and for web-enabling.

Some vendors try to sell products that uses the HTML inside the RPG sourcecode, but this is not SOA! As you then still have the visual part inside the program and you have to change code each time you want the visual part changed and not the service it self. The program is then hardcoded to be used in a HTML page and not as a true flexible service.

So we create a simple HTML page on the webserver to use for this. Here you can see the simple HTML page we use in this example.


































HTML sourcecode
0001 <html>
0002    <head>
0003    </head>
0004    <body>
0005       [[field01]]
0006    </body>
0007 </html>

So now we have the XML from the SOA module, in Class 1 - Hello World (click here to see xml)

To see the html page click here (remember that you only see the "field" as the other html tags is interped by the browser)

Now the only thing we need to do (this has been done for you) is to let the "service bus" know the name of the HTML page, and that we want to execute the program and then the htmlpage, in that order (this is called a business process)

To test the business process, and show the outcome in the "result frame" click here. It will show you the same html page again, but now the value of the field [[field01]] is shown. Nothing fancy, but there is a few important points to it.

Underneath, you called the same program a before (SOA), the only difference is that we instructed the system to merge the xml-document from before with the html page. iSeries2web replaced the [[field01]] in the html page with the value from the xml-document.





Edit

Next class

Lets try to send data from the webpage to a SOA module...
Go to Class 3 - Calculator