Forums
Is it possible to use the IceBreak HTTP server as a replacement for Apache for applications that have already been written? To be more specific, if I have an RPG program that reads from stdin using QtmhRdStin and returns output via QtmhWrStout can I call that program via the IceBreak HTTP server and have content returned to the browser? Even if it is not possible now, would it be possible after a little bit of pain on my part?
IceBreak uses the direct way
IceBreak uses the direct way to read the request from the browser and write the response back again. Opposite if you use appache, your programs use the stdin & stdout to communicate with the browser. Stdin & stdout are files that must be handled and here you have the problem with performance and Appache. Therefore it will not help if IceBreak could do the same as Appache. However, it would probably not require a big job to rewrite the programs to IceBreak.
In IceBreak there is a number of Build in Functions (BIF) which makes the approach to request & response very simple. E.g. you can move data from the URLs parameters with the function Qrystr (Alfanumeric) or Qrystrnum (Numeric)
Sample:
>From your browsers url:
http://myserver:8080/myrpgpgm.rpgle?custno=1234
RPG:
/free
...
Custno = qrystrnum('custno');
Chain custno customer;
...
When it comes to the form fields from the browser, there is BIF's to read them as well.
The HTML file:
<html>
<form action=" myrpgpgm.rpgle " method="post" name="form1"> Enter Customer name, and press enter:
<input type="text" name=" CustName">
</form>
</html>
The RPG program
...
CustName = form('CustName':CustName);
Update customer;
...
And when you need to send information back to the browser you can simply use BIF's like "ResponseWrite"
ResponseWrite('<html>The customer name is: ' + custName + '..');
I hope this can help you further in your search for the perfect solution.