Link to home
Start Free TrialLog in
Avatar of bhlang
bhlangFlag for Canada

asked on

How to Send an HTTP Request from an iSeries server to any other server

I am working on an AS/400 (iSeries) server with OS/400 V4R5

I need to send an HTTP Request to another server (Microsoft BizTalk; outside of my control) to exchange data from the iSeries server. The tools I would prefer to use are CL or RPG. Others may be considered.

At present, we have to download the data file to a PC and then use a web browser to send it to the outside server manually.

We would like to automate this process so that the user just has to trigger the procedure on the server. It may even become an automated process (ie. every day at close of business).

Can anyone tell me how I can do this on the iSeries?
Avatar of Member_2_276102
Member_2_276102

bhlang:

Are you familiar with such programming on other platforms and want an intro on how to do it via CL & RPG? or do you need direction on the methods in general?

Tom
hi bhlang,

iSeries doesn't have browser/HTTP client capability.
You may have to find another way to transfer the data,
OR
do the automation on the PC, i.e., automate the download and POST to the HTTP server.
Avatar of bhlang

ASKER

tliotta: If you know of a way to do this on the AS/400, then please let me know. I've never programmed this stuff before, but I do have an example for Visual Basic (which I am familiar with).

dedy_djajapermana: Are you absolutely certain of this? I'm hoping to find something that will help me here.

I did find A solution for this problem but it's quite costly. It's a set of tools from nuBridges and can be found here: http://www.nubridges.com/solutions/http.htm
It's far more money than I would spend for these tools.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_276102
Member_2_276102

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Theo Kouwenhoven
Hi bhlang,

This is not an answer on your question but an other approach ( or call it a work around if you like)

If you are activating the AS/400's webserver, you are able to directly link to that server, and copy the information from the AS/400
to a PC folder by  the Copy To Stream File

CPYTOSTMF  FROMMBR('/qsys.lib/my400lib.lib/my400file.FILE/myMember.MBR') +  
                    TOSTMF('/myPCdir/myFile.htm') +                      
                    STMFOPT(*REPLACE) STMFCODPAG(*PCASCII)                    

I use this to generate some static HTML sales info pages, for intranet use, daily, and it works great





Avatar of bhlang

ASKER

murphey2: The Windows server in question is outside my control.

tliotta: I will evaluate that HTTPAPI package. At first glance it appears that it may need us to get a Digital Certificate which is also not an inexpensive proposition.
Do you need to POST or GET information from the server or Both ???

Because if you only need to POST information it can be done quick with a simple request with Socket programming.
bhlang:

AFAIK, you'll only need certificates if you require SSL... (the server wants SSL for you to send to it??)  But if you require SSL, you're pretty much going to need a certificate no matter how you go about doing it (assuming the requirement for certificate is the client side, i.e., the server requires client authentication which seems uncommon).

Further, if the HTTP server admin agrees to trust your certificates, then use OS/400 to create your own. Install the certificate management stuff and make your AS/400 into a certificate authority and create one. The HTTP server admin could then add your CA to his trust list.

Tom
Avatar of bhlang

ASKER

Helixir: I need to create an HTTP POST Request and send it to the BizTalk server. I have the URL I am sending to, the SOAP wrapped XML file, the username and the password. AFAIK, I don't need any other pieces. CAN this be done with a simple request with Socket programming? IF so, please provide an example.

tliotta: The url of the server I am sending to starts with https. I may have to follow through with you on the certificates side of things later on.
bhlang:

I can provide general guidance on certificates (and happy to do so). But it gets into some deep stuff if you aren't already versed in it, as does any coding you might decide to do for encryption if it goes that far.

I would hesitate to give advice beyond pointing to technical directions. Be aware that you might need support beyond what could be provided here by pretty much anybody. (Probably not, but it needs to be mentioned.)

Tom
Avatar of bhlang

ASKER

Looks like the HTTP API will do what I need it to.

Thanks.