|
> to get the job done, but where they can't do any damage to the system. Now > that I've got pass-by-value and pointers I can access all of the APIs that > the C programmers have always had access to!!! Not to mention calling MI builtins... you can do all sorts of funky stuff. But this isn't new, we've had these capabilities for, what? 8 years? > I was looking at Scott Klement's excellent tutorial on socket servers, and I > have been wondering how I could utilise them in my work. Tonight I was > looking at some Perl code in a HTTP manual that was for creating a trivial > HTTP server to sit on a designated port. The similarity of the code was a > little disturbing! Has RPG IV progressed that much?!?! I suddenly realised > that I should be able to easily knock up a primitive HTTP server in RPG and > have it sit on a designated port (my little perl). It would simply be a > matter of creating a URL to that port on my AS/400 and I would be off and > running: I could process simple GET requests from the browser and serve > basic HTML pages that allow the user to enquire on certain business details. > > Question: Is this possible? Am I being stupid? You could... but why? OS/400 comes with a very robust and powerful HTTP server (err.. actually 2 of them!) at no extra charge. Why would you write your own? As with all HTTP servers, you can have it call your RPG programs as CGI scripts, and have those scripts deliver the business content. > My understanding of TCP/IP based communications is pretty sound. I would > need the server to convert the received data from ASCII to EBCDIC, process > the HTTP request, based on the header details. I would then need to generate > some HTML, convert to ASCII, and send it back. Or simply retrieve a template > HTML document from the IFS and modify it. As my requirement would need a > stateless HTTP communication I wouldn't need to worry about cookies and such > like. There's a package called CGIDEV2 that's available for free that allows you to create HTML templates and work with them in your RPG program. Works really well -- rather than reinvent the wheel, maybe you should try that? http://www-922.ibm.com > Our company use HTTP servers to communicate with our customers (internet > orders), but our AS/400s are used as database servers in that application > model. Consequently, we don't have any HTTP servers active on the AS/400s. I > would not imagine that our company would go to the expense of > configuring/maintaining the servers so I can run my very specific > browser-based application. So, I'm left with toying with the idea of > creating my own RPG-based HTTP server. The HTTP server comes with OS/400... if you've got OS/400, you've got the HTTP server. Sure, there's the cost of the employee's time to install and configure it -- but surely writing your own would take longer? > So, what do you think? Is it possible? Is it desirable? Will it be > practical? Could I set it to allow multiple simultaneous communications? Could you? Sure. But it would take a lot of effort to make it as fast/robust/secure as the one you can get for free... Why reinvent the wheel?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.