• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3956
  • Last Modified:

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?
0
bhlang
Asked:
bhlang
1 Solution
 
tliottaCommented:
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
0
 
dedy_djajapermanaCommented:
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.
0
 
bhlangAuthor Commented:
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.
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
tliottaCommented:
bhlang:

Programming for this is no different on AS/400 than other systems with the general caveat that CCSID must be obeyed. (That is, in basic terms, you'll probably be running under an EBCDIC code page and need to perform ASCII/EBCDIC text conversion; but that's the easy part.)

This would be done via sockets programming. If you know sockets, then there's no need in discussing them. If not, then I must recommend two beginning points.

First, there is a superb tutorial for all sockets stuff under OS/400 at:

http://www.scottklement.com/rpg/socktut/

Scott Klement is a leader in this area and provides excellent info. Beyond simple sockets, he also makes this available"

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

...an HTTP API that implements HTTP 1.1.

If you prefer more of your own programming, IBM can provide some help while you're learning sockets. The IBM Custom Technology Center has a bunch of related pre-written software packages that are very useful. Most can cost a good chunk of change, but one is freeware for the cost of filling out a form/request that tells IBM CTC about the project you're working on.

The TCP/IP Socket Client APIs can be gotten to from here:

http://www-1.ibm.com/servers/eserver/services/assets/tcpipcomponents.html

I've used those at every site I've worked at for a good ten years and have been very impressed. These APIs give the ability even to write sockets clients in old OPM CL. (I've written both SMTP and POP clients in OPM CL with this API set.)

Not sure what to mention after that.

Tom
0
 
theo kouwenhovenCommented:
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





0
 
bhlangAuthor Commented:
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.
0
 
HelixirCommented:
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.
0
 
tliottaCommented:
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
0
 
bhlangAuthor Commented:
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.
0
 
tliottaCommented:
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
0
 
bhlangAuthor Commented:
Looks like the HTTP API will do what I need it to.

Thanks.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now