× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Esteemed list,

 

Recently I seem to have developed a fascination with the capabilities of the
ILE in general, and the role of RPG in particular. The penny has finally
dropped and I realise that once it was made possible for me to access C
functions from my RPG IV code I could do pretty much whatever I want on the
AS/400. I now feel much less of a consumer of the operating system. Before
this I always found the API interfaces somehow sterile, like a safe
interface (or sandbox) where the RPG programmer can do what they need to do
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!!!

 

Anyway, I digress.

 

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?

 

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.

 

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.

 

So, what do you think? Is it possible? Is it desirable? Will it be
practical? Could I set it to allow multiple simultaneous communications?

 

Is RPG up to the job??? 

 

Be as hard as you like, I can take it. ;-)

 

Larry        

   

 

  


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.