For writing and reading records you would need, as I see it, a CGI program.
I believe that the IBM i "standard" for doing so with RPGLE is CGIDEV2.
Although I realize that this is a "3rd party" software, the guys at
www.easy400.net have a lot of demos (including source) at:
IBM Certified Systems Expert -- eServer i5 iSeries