Thanks again Scott!
I've sent a request to our Operations Manager to load the GSKit APIs and HTTPAPI.
I believe I'm going to try to go the HTTPAPI route, and I'm going to start researching Expat
(I'll trust your experience that my project may be too complex for XML-INTO).
I found the link on your site to the articles on Expat.
Do you have any links to HTTPAPI articles / tutorials / sample programs for beginners like me?
(I might as well also mention, another part of this project is going to involve sending/receiving XML files by Secure FTP
for a batch process, but that's another can of worms I have to open.)
Charlie
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Tuesday, January 26, 2010 3:36 PM
To: RPG programming on the IBM i / System i
Subject: Re: RPG sockets HTTPS subfolder
Hello again,
On 1/26/2010 12:56 PM, Versfelt, Charles wrote:
I thought I could "send" nonsense if I wanted, just to test the
ability to send, but obviously in this case it has to be a real
language the server will understand, as I now know.
You can send anything you want to, including nonsense. Just as when you use the phone. You could call the operator and say "bibbity bobbity boo, oink dink wham!"
The operator would be very confused, and would probably hang up on you... but you could do it.
Likewise, if you send the string '<test>' to an HTTP server, it won't understand what you're talking about. '<test>' isn't part of it's language. You can certainly send it if you want, but it'll be very confused, and will probably hang up on you.
However, that assumes you're communicating with an HTTP server. HTTPS requires cryptography to establish trust, exchange digital encryption keys, and more. You can certainly do this with the basic socket API if you want to -- but you'd have to write all of the cryptographic stuff yourself if you did that. Good luck with that.
Or you can use GSkit (or one of the other 2 SSL APIs included with
OS/400) and use IBM's crypto routines so you don't have to write your own.
Now I know I need a different tool, not the socket APIs, but the GSKit
APIs.
No. You still need the socket APIs... You also need the GSKit APIs.
They work together in tandem.
I was envisioning using sockets for the communications and (also from
another article you wrote!) the XML_INTO and CGIDEV2 to receive/create
the actual XML.
You can do that if you like, provided the XML is simple enough to use with XML-INTO. In my experience web services (which is what you're doing, I don't know if you realized that) have XML that's too complicated for XML-INTO.
XML-SAX could do it, though. Or Expat. (Or the XML parsing wrappers for Expat that I provide with HTTPAPI)
I imagine I'll use the GSKit API (or HTTPAPI?) for the
communications, and XML_INTO / CGIDEV2 for the XML creation&
extraction. At least I now know the direction I have to move.
Just to be clear... HTTPAPI is *my* HTTP/HTTPS communications tool,
that *I* wrote using sockets and GSKit (amongst other things).
You're welcome to download HTTPAPI and use it, it costs nothing. Then
you don't have to write your own sockets/ssl/xml routines. Mine are in
use by quite a lot of people already, and they've already been tested
rather thoroughly, et al.
There are similar tools to HTTPAPI available from other people as well.
But mine is better. (And I'm totally unbiased!)
But you can certainly write your own from the ground up if you want to.
But since you're a beginner, I think you'll find a lot of things to be
difficult about it.
As an Amazon Associate we earn from qualifying purchases.