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



HiThanks, this code works great, i was able to get the IP address of my
machine running client access.


On Mon, Aug 17, 2009 at 2:47 PM, Mark S. Waterbury <mark.s.waterbury@xxxxxxx
wrote:

Hi, Ash:

You could use the following little CL *PGM to retrieve the IP address of
the "client" of any telnet session:

PGM PARM(&ADR)
DCL VAR(&ADR) TYPE(*CHAR) LEN(15)
DCL VAR(&RCV) TYPE(*CHAR) LEN(1024)
DCL VAR(&LEN) TYPE(*CHAR) LEN(4) VALUE(X'00000400')
DCL VAR(&ERR) TYPE(*CHAR) LEN(96) VALUE(X'00000060')
DCL VAR(&DEV) TYPE(*CHAR) LEN(10)
DCL VAR(&FMT) TYPE(*CHAR) LEN(8) VALUE('DEVD0600')
DCL VAR(&ZERO) TYPE(*CHAR) LEN(4) VALUE(X'00000000')
RTVJOBA JOB(&DEV)
CALL PGM(QDCRDEVD) PARM(&RCV &LEN &FMT &DEV &ERR)
IF (%SST(&ERR 5 4) *NE &ZERO) +
CHGVAR VAR(&ADR) VALUE(%SST(&ERR 8 7))
ELSE +
CHGVAR VAR(&ADR) VALUE(%SST(&RCV 878 15))
ENDPGM

If a user connects direclty from ClientAccess 5250 emulator (or TN5250)
on their PC, this will be the IP address of that PC.

But, if a user issues the telnet command from one i5/OS system (or LPAR)
to another, this will be the IP address of the originating i5/OS system
or LPAR.

Hope that helps,

Mark S. Waterbury

> Ashish Kulkarni wrote:
HiI was thinking of setting up java program as a web service and then
embed
with tomcat runtime to start it on PC.

But then again i will get stuck about the URL, how can i know the URL of
the
web service running on local PC, Again the same problem with knowing the
IP
address of the user so i can call the web service on local PC.


Ash

On Mon, Aug 17, 2009 at 2:10 PM, Scott Klement <
rpg400-l@xxxxxxxxxxxxxxxx>wrote:


Hi Ash,

Why not set up the Java program on the PC as a web service? That seems
to be the modern approach to this type of application.

If it really must be invoked as a normal program, you could use the
RUNRMTCMD command or the rexec() API. These two tools speak the same
network protocol, but the API lets you get the information straight back
into your RPG program, whereas the CMD sends it's output to the spool --
so you have to copy it back to a PF and read it into your RPG program.
RUNRMTCMD/rexec is plaintext and unencrypted, though.

The SSH program from OpenSSH (available in PASE via 5733-SC1) allows a
remote command to be run on another system via a protected/encrypted
connection. However, I don't know how to run an SSH daemon on Windows
(it's probably possible, but is something I've never looked into, since
we don't use Windows in that capacity here.) I've used it against a
FreeBSD server and it works very nicely as well.

Good luck


Ashish Kulkarni wrote:

HiIs it possible to call java program on PC from RPGLE or CL program,

What i want to do is to get the windows networking user id used to
login

in

my RPG program,

I can have a local java program which can return the windows user id,
but
can i call this program to get this information from AS400?

I already have a program which will open internet explorer on PC from

AS400

(runs in client access) using STRPCO and STRPCCMD, but this is only to

pass

information from AS400 to windows, but i would like to get response
from
windows back to AS400.

Is this possible to do so?


Ash

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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 copyright@midrange.com.

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.