[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Server Program?



 

 

-----Original Message-----
From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Friday, September 10, 2004 6:09 PM
To: ftpapi@xxxxxxxxxxxxx
Subject: Re: Server Program?

 

Sender: Scott Klement <klemscot@xxxxxxxxxxxx>

 

 

> I have used HTTPAPIs in several program to contact a URL and receive

> information back. I now have a need for a program that will receive a

> request from another system and send data back to it. The data sent back

> could be as little as a couple of words to as much as data in a file.

> How is the program setup to get the question.

 

Will the other system be using the HTTP protocol to do this?  Or is this

something else entirely?

 

The other system will be using a HTTP://as400.ducks.org:XXXX/cgi_bin/program1.pgm?key=XXXXXXX  

what I need to happen is when program1 is started and processes the key that was passed to it through http I need to send data back to the program that issued the http call on the other system. How do I build program1 to do that?

 

Unless you have a compelling reason to do otherwise, I think that the HTTP

protocol is a good way to do it -- it's becoming something of a "standard"

for distributed APIs.

 

Though, there are still good reasons to use other methods...

 

> I have looked at the documentation on the Socket Tutorial and setup all

> the examples. I am not sure if that is the way to go or not. Some

> examples of a program like this would help. Any help will be greatly

> appreciated.

 

Assuming that you want to use HTTP for this, the web server that comes

with OS/400 can help you out.  You can have that web server call an RPG

program (or any other language that runs on the iSeries!) and send you the

information that the remote computer has requested.

 

You can then take that information, process it, and spit out a report or

whatever you need to spit out.

 

There are various utilities available that can assist in this task.  The

most popular one is called CGIDEV2 and is available from IBM at no charge.

You can find it here:

http://www-922.ibm.com

 

Brad Stone also has a toolkit for this type of programming, and he has

written a book on the subject called "e-RPG."  I haven't read it, but I've

heard good things about it.  There's more information about it on his web

site:

http://www.bvstools.com

 

I have that book and have used it many times. I have several CGI programs but from everything I have seen in them is that it writes out HTML code. I need to send data from my program to the program that initiated the call to my program.

 

-----------------------------------------------------------------------

This is the FTPAPI mailing list.  To unsubsribe from the list send mail

to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr

-----------------------------------------------------------------------