Hi David,

> Every time I look for references about HTTP in the archives or the
> Infocenter it seems to be in the context of using the iSeries as a HTTP
> server but what I would like to know is if such a connection can be made
> *from* the iSeries to another system.  If it can't be done with a native
> command how about via QShell or something else?

I do this all the time with my open-source (free) HTTPAPI utility.
HTTPAPI is designed to be incorporated into an ILE RPG program, allowing
you complete control over the transfer.

If that interests you, you can find out more at the following link.

http://www.scottklement.com/httpapi/


> Ultimately what I want to do is transmit a file using a digital
> certificate.  Since this is a routine transmission I would like to automate
> it either with a CL program or with a file containing the commands that can
> be used as redirected input to another command.  I've done something
> similar with FTP (without the digital certificate) in the past but so far I
> haven't seen anything about how this might be possible with HTTP.  The
> recipient wants this to be sent via their web site.

Yeah, I really hate those batch FTP things, myself.  They're extremely
error-prone.

BUT ANYWAY... HTTPAPI also supports SSL-encrypted transmissions with
digital certificates, et al.  It does require OS/400 to have the
appropriate licensed programs installed so that IBM's SSL environment is
available -- but if you're doing SSL telnet or SSL HTTP now, you've
already got those.

> The entity that we will be sending to has provided an example of how to do
> this manually from Windows as well as providing the sample Unix script
> below.  Thanks for any ideas or advice.

Doing the same thing with HTTPAPI only requires something like this:

    c                   eval      rc = https_init('MY_APPLICATION_ID')
    c                   if        rc < 0
    c                   eval      error = http_error(rc)
    c                  ... send error message somewhere...
    c                   endif

    c                   eval      rc = http_url_get(
    c                                  'https://www.abc/com':
    c                                  '/path/in/ifs/myfile.txt')

    c                   if        rc < 0
    c                   eval      error = http_error(rc)
    c                  ... send error message somewhere...
    c                   endif


The certificate setup is all configured in the Digital Certificate Manager
(IBM's web-based digital certificate configuration tool) all you have to
do is reference 'MY_APPLICATION_ID' in the Digital Certificate Manager.

There's a sample program calle EXAMPLE3 that you can look at to get a more
complete example of doing it with HTTPAPI.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.