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



Eric,

I don't have a simple example I can share but it's not that hard to do.
Here's what you need to have:

* A web accessible program to handle the input, call the program you
want to use, and return the response. It can be written in the language
of your choice.
* A program to call the web program. You can do this using sockets
(which is what I did back in November of 1999) or even better would by
something like HTTPAPI which handles all of this for you. Besides
calling the web program, this one also needs to be able to parse the
results.

You'll need to decide on how the input and output is described. What I
did uses name/value pairs (the input used a POST, the output was
returned by the called CGI program in the body section of its output).
SOAP is another example of how to describe the input and output of the
call. You can even come up with something different that suites your
needs better.

Speaking of SOAP, you can use this with nothing more than HTTPAPI on the
calling side. HTTPAPI includes an XML parser (the name slips my mind) or
you can decode the XML using other methods (like %scan). Our warehouse
system does this to call a web service that runs on WebLogic on a
Solaris server.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DeLong, Eric
Sent: Friday, September 28, 2007 10:22 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Alternatives for remote program call

This would be using Apache to host this as a web service? I had some
issues when I tried to generate pcml for this program, as one of the
parms is a DS that includes varying length character fields. This would
be easy to fix except that this is a standard type structure that we use
in several applications. I was hoping to retain this for compatibility
reasons, but I suppose I could just copy these varying length fields to
a fixed length clone DS....

Do you have any simple samples you could share?

Thanks,
Eric

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of matt.haas@xxxxxxxxxxx
Sent: Friday, September 28, 2007 9:09 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Alternatives for remote program call


Apache doesn't kill the 7xx boxes (its way better than the original
server). We have a 720 with 1GB of memory, 3 WebSphere 5.1 instances,
and 8 Apache instances (three of them use SSL) running for testing and
most of the time it runs okay. WebSphere honestly kills the box
performance-wise (mostly due to lack of memory -- the box is maxed out)
but you can do web services in RPG and you don't need to use SOAP. This
720 was our production web box for several years (it replaced a 50S) and
we never had performance problems with it until we started running
several Java apps.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DeLong, Eric
Sent: Friday, September 28, 2007 9:55 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Alternatives for remote program call

Yes, I've already begun considering DDM and DataQueues as alternatives,
though I haven't settled on anything yet. This would actually be a
pretty good fit for web services, but that's an expensive solution in
terms of CPU and memory (these are AS400 7xx boxes...)

I'm thinking too that, on the remote call (that contains the offending
CONNECT TO), if I can disconnect the invocation of the vendor code by
using a parameter file or data queue, that the remote SQL call would
work fine. Lots of potential solutions...

Thanks for the suggestions.
Eric

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of qsrvbas@xxxxxxxxxxxx
Sent: Thursday, September 27, 2007 6:43 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Alternatives for remote program call


DeLong, Eric wrote:
5. Alternatives for remote program call (DeLong, Eric)

I have the need to remotely call a program with full bi-directional
parameter support. My first thought was to use SQL (Connect to xxx;
CALL nnnnn (:p1, :p2, :p3)) to invoke this program, but as it turns
out, that called program issues a SQL CONNECT TO. This is not
allowed, it seems.....

I'm trying to consider alternatives, but so far I'm not finding
much....

I was wondering if it would be possible to write a Java program that
would use the Java Toolbox to remotely call my RPG. I am not very
familliar with the Java Toolbox, so I'm not sure it it even supports
bi-directional parameters. Has anyone done something like this?

Eric:

One possibility comes to mind that I haven't seen here yet. Try the Call

Program (QxdaCallProgramEDRS) API. But I'm not at all familiar with what

calling with an EDRS API might do to a SQL program that's doing a
separate CONNECT.

The difficulty in calling a remote program and getting parm values back
is something like figuring out how to get parm values back from a
SBMJOB. Not trivial at all. Good luck, especially if you're in a hurry!

You might have results sooner by thinking about ways to communicate via
DDM *dtaqs or *dtaaras.

Tom Liotta


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.