Invoking a script on a nonWM server

I need to be able to invoke scripts on servers that do not have WM components installed on them.

I will have the Host, port, login, pw, as well as the path and script to be executed. It will be necessary to establish a connection to the non-local server, execute the script, retrieve the success/failure status, then close the connection.

Since it is not on the same WM server, I cannot use the pub.remote.invoke commands.

Has anyone done this before? I’m leaning towards doing this in Java unless you have another suggestion.

Does the “Executer Adapter” sound familiar to anyone??? A post on Advantage.webmethods.com forum mentions that this adapter would perform shell functions on a remote box. However, I have been unable to find information on this adapter.

I think the Executor Adapter was for Enterprise but I may be wrong.

Can the remote machines be accessed via a sharepoint/mount? If so, then that may help do what you need.

Interesting option, but we cannot remote mount the machines.

> I need to be able to invoke scripts on servers that do not
> have WM components installed on them.

I take it you want to remote invoke OS-level scripts (eg: shell scripts) right? You could use secure shell (ssh) and its remote invoke options. See: [url=“http://openssh.org/”]http://openssh.org/[/url]

You’ll have to install ssh on your local machine and sshd on the remote machine. Then you setup ssh (key setup etc). Once setup, you can securely run a remote script by simply running this command on your local machine:

ssh remote_user@remote_host command

I/O redirection is taken care of automatically. IIRC you can also use ‘ssh-agent’ to make this technique more secure.

ssh / sshd are also available under Redhat’s free cygwin tools for windows. See: http://www.redhat.com

Hello

i am new here.

I have a question which is somwhat related to this thread.

How can I invoke services residing in IntServr from a remote AS/400 (which has no WM components).

Replies appreciated
Thnx

You can do an HTTP post to invoke any IS service. The Integration Server Developer’s Guide has details.

I think there are three approaches that would work depending on what you have installed on your AS/400.

  1. If you can perform an HTTP post, use Rob’s suggestion. To invoke the service PostOrder in the OrderManagement folder with the parameters OrderID = 123 and OrderAmt = $300 use the following URL:

http://isHostName:isPortNum/invoke/OrderManagement/PostOrder?OrderID=123&OrderAmt=300.00

  1. If you have Java running on your AS/400 you can generate a java client app using Developer that can invoke the PostOrder service

  2. If you are using web services and can consume web services from your AS/400 post the appropriate SOAP message to http://:/soap. You can use Developer to browse existing IS services and generate WSDL files or sample requests if necessary. The body of the SOAP message (without the envelope) would look like this:

SOAP-ENV:Body
<ser-root:PostOrder xmlns:ser-root=“http://isHostName/OrderManagement” SOAP-ENC:root=‘1’>
123
300
</ser-root:PostOrder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

There are probaly a couple of other alternatives that might also be good fits depending on how your AS/400 is configured, but that should get you started.

Regards,

Mark

What about using socket connections to connect to a remote server? Will I then be able to execute the remote scripts?

I think if you have an FTP server on the remote box, you can put a dummy file and invoke a script. Usually FTP servers support this kind of operation.

Thanks to Mark and Rob

in regards to the 3 options - option 2 includes

import com.wm.util.Table;
import com.wm.data.*;
import com.wm.util.coder.IDataCodable;
import com.wm.app.b2b.util.GenUtil;
import com.wm.app.b2b.client.Context;
import com.wm.app.b2b.client.ServiceException;

which the AS 400 would not have

and option 3 is only if you have web services on the AS400

So I think, i have to go about using the HTTP POST , could somebody please direct me to the right sources where I could use HTTP POST using RPG

THNKS
WMD

The packages you need are all contained in the client.jar file which can be deployed to your AS/400 server. The client.jar file is found in the Integration Server’s \lib folder.

Sorry, my RPG skills are pretty rusty. I’m sure the solution involves holding the programming template card in front of the 5250 green-screen terminal though. :wink:

Mark

WMD,

Hmm. Is your handle allowed by the U.N.?

Hopefully, you were just kidding about having to do an HTTP post using RPG/400.

However, thanks to Google, you can look here if you really must do such an arcane thing:

[url=“http://www.bvstools.com/cgi-bin/bvsdl?dlfile=http://www.bvstools.com/geturisrc.zip”]http://www.bvstools.com/cgi-bin/bvsdl?dlfile=http://www.bvstools.com/geturisrc.zip[/url]

Mark

I am not able to invoke a script in my ftp window. Do you know how I would do that?


Posted By PU on Thursday, February 27, 2003 - 10:05 pm

I think if you have an FTP server on the remote box, you can put a dummy file and invoke a script. Usually FTP servers support this kind of operation.

RandyB - Clarifying my post on using ssh:

You need to get the WM server to execute this local
OS-level command:

ssh remote_user@remote_host remote_command

…which in turn invokes ssh to execute the remote
OS-level commands. To execute a local command from a WM
server, check the WM examples or the code posted in the
forums.

I’m not a sysadmin, but I understand that using ssh to
execute remote commands is a system admin ‘best practise’.
Remote monitoring tools like netsaint/nagios use it, for
example.