× 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.



You can sleep over both your ears. AS 400 can do communication using https. And it is not difficult.

One of the computers should ask for data, and the other one should provide the answer. Sometimes the roles will switch, depending on the need and the way you (and the others) define the protocol.

In order to test the procedures, you need to ask your "web guy" to set up a GCI program that will receive some data, store it on disk and reply with something easy to identify, like the actual time.

If the web server is properly set, you should be able to read any file in the directory they set for you, but you should not be able to write anything. Communication must be donne between programs.

Versfelt, Charles wrote:

Hi again,

Please forgive me for my "beginner" questions, it's frustrating that no one at my company knows the socket/HTTPS/HTTPAPI
And I have to learn it on the fly...

My web guy, of course, doesn't know RPG or iSeries or HTTPAPI... He only knows the web.

When I asked on here about sending nonsense, you (Scott) gave the analogy of calling an operator and saying "bibbity bobbity."

I'm suspecting from that answer, that what my web guy asked me to do on the outset of this project... Makes no sense.
That my request has been "bibbity bobbity" and that's why I'm trying to do "bibbity bobbity."

Here's the situation: The actual project, we will have an https site to send and receive payment data, is not yet ready.
That is, I'm still waiting for people in the management end for the "outside" site I'm ultimately going to send and receive data.

In the meantime, I've been asked as a "proof of concept" to prove that I can send something, anything, from an RPG program on the iSeries to an https site.

My company has its own https site, as well as a beta development https site, which is used for other purposes.

Our web guy told me, just send anything to that site. He set up a folder on the site, he gave me a URL, in the form of "https://xxx.abc/def/ghi";) and said, "Send me something there, anything."

I said, "I was told it has to be valid XML instructions," I even gave the analogy of the "bibbity bobbity."
He said, "Sure, send me any XML, I don't care what it is. Drop it into this folder and I'll see if I can open and look at it."
I described the sample program with the UPS tracking#, he said just to send that, whatever the UPS site gets in the sample program. He seems to think that I can send anything and it will show up in his folder as something he can read.

Correct me if I'm wrong..... What he's asking for doesn't make any sense, does it?
I can't just send him anything... Can I?

Doesn't the https site itself have to have some web programming on his end (analogy: "the operator") that is looking for specific type of intructions (XML in the format expected by the site, in the analogy, speak the language the operator understands, as for example, a UPS site has some sort of web programming that expects to see <AccessRequest> and then, inside that, <AccessLicenseNumber> and etc.) and if the https: site doesn't have some sort of web program expecting to see those commands, then it's like a telephone with no operator and it all becomes gobbeldy gook?

He seems very sure that I should be able to just get a connection from my AS400 by plugging in the URL and then drop anything into his folder, and he can read it.

I tried taking the EXAMPLE programs (5 and 12) and changing the UPS URLs to the URL the web guy gave me, and then just run them exactly as is.

They come back with rc = -1. My web guy sees nothing.

Am I getting -1 because I really need to hit an https site that is expecting something meaningful to it, that the https: site has to have something waiting for specific XML commands?

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.

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.