|
Hi Larry, > Why? The challenge, the deeper understanding of the protocols I'd gain, the > fun I'd have! You see, I'd have to sit down and learn how the whole thing > hangs together (TCP/IP, HTTP, HTML or XML, etc.). What better reason to do > it? Consider it an out-of-hours hobby. I just didn't want to build my own > back-yard rocket ship to find out that the engine doesn't fit. ;-) As a learning experience, I think it'd be great idea! Though, I'm not sure that you'd have to learn much about HTML or XML... but I guess you'll learn that too. The official internet standard for HTTP is RFC2616... it does a pretty good job of explaining how the protocol works. I'd suggest reading RFC2616, and then looking at how your small perl script works for a good start as to how a web server should work. There are many other RFCs that add details here and there, but 2616 is the main one that explains the bulk of the protocol. You can read it here: http://www.faqs.org/rfcs/rfc2616.html Apache is open-source as well. If you really want to learn a lot, download and study the source code for that, and compare it against the relevant internet standards. > On a more practical note: How do you set up RPG programs as CGI programs? > How are they called from the standard web servers? Do they need to be > written to use STDIN and STDOUT or can they take parms? I mean, if it isn't > THAT difficult to fire up the HTTP server then I might try and get the > company to buy into the project. However, I'd imagine that I'd have a better > chance of convincing them if I had a working prototype. POST requests are handled through STDIN/STDOUT, GET requests from an environment variable. There are CGI APIs that can be used to simplify this task, or you can use CGIDEV2 which simplifies it even more. For info on setting up the web server: Go to the Information Center. A convienient URL for it is http://www.iseries.ibm.com/infocenter Once you've told it your region, language and release of OS/400, you should click on: e-Business and Web Serving -> Web Serving That will give you lots of info on the web server, how to get it running, etc. Make sure you subscribe to the WEB400 mailing list here at Midrange.com, and ask any questions you have on that list. For info on CGI programming on the iSeries in the Infromation Center, click: e-Business and Web Serving -> Web Serving -> Reference -> Common gateway interface (CGI) There's a link on the CGI page that points to the CGI APIs which you'd call from your RPG program. > You know what senior managers are like - if I gave a demo of the > browser-based enquiry screens they'd wet their pants. They wouldn't care > how it was handled. If I then added "but we'd need to fire up the HTTP > server for scalability, stability and security reasons" they say fine. > If I asked them to fire up the HTTP server so I can have a play they'd > probably say "Er. no!". So my little server may well provide me with > enough leverage to get the company to buy into the idea. Actually, I really don't know what they're like. I'm the IT Manager of my company, and I get to make the decisions like that. Though, if there's a significant cost associated, I have to get approval from the CFO, but in this case it's free, so I could do what I want... On the other hand, if I were to have a programmer spend hundreds of hours writing a web server, I'd have to take heat from every department in the company because it would take resources away from their projects. So, simply firing up the existing server, and pointing it to an RPG CGI program would be much, much easier for me to approve. But, if you want to write a web server on your own time to learn about the protocols, I think that's great. I do a TON of stuff like that, I take open source projects and read the code to see how it works, I read the internet standards, I write stuff for the fun/learning experience (pretty much everything on my web site is an example of that... the sockets tutorial, HTTPAPI, FTPAPI...) So I'm all for it! Yes, people, that's what I do with my free time. Pathetic, isn't it? It's just very unusual to meet another RPG programmer who does stuff like that. Granted, on other platforms it's very common -- but on the iSeries it's very rare. I'm very used to RPG programmers who "don't have time" to learn anything more than what they absolutely need to get the job done. They're constant goal is to get the job done as quickly as possible -- and I've reached a point where I just assume that this is true of everyone asking a question... :)
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.