Jump to content

Is there a way to send XML msgs with AutoIT


Recommended Posts

I work on a large network, and have servers all over in different cities. I need to access data or make queries to these databases on a daily basis. We have shell scripts set up on the servers for the data we need to retieve, however, I still need to manually open an SSH or send an XML request to these servers to run the shell script or to return the requested data from XML. I would like to build an automated script that would make these connections automatically. So is there a way to send XML requests with AutoIT, or can I make an SSH connection to a server using AutoIT?

Can I make an sftp connection? I occasionally have to ftp over to some of these servers to retrieve files, but it requires an ftp client that uses sftp. I do not have such a client, so I have a co-worker retrieve the info who uses an ftp client that can make such a connection. I see that I can do ftp retrieve, but can it make an sftp connection?

Also, if any one has an answer to my problem here http://www.autoitscript.com/forum/index.php?showtopic=15010, which would allow me to skipmaking my own connection via SSH and just launch PuTTy instead. The problem is the script doesn't seem to be able to retrieve the window text.

Link to comment
Share on other sites

Can I make an sftp connection?  I occasionally have to ftp over to some of these servers to retrieve files, but it requires an ftp client that uses sftp.  I do not have such a client, so I have a co-worker retrieve the info who uses an ftp client that can make such a connection.  I see that I can do ftp retrieve, but can it make an sftp connection?

If you have a console sftp client that will accept redirection of STDIN (not all console apps do, e.g. Win XP's telnet.exe) you can run it with StdinWrite and StdoutRead from the AutoIt beta release.

I see that PuTTY has a console sftp client.

[Edit: Added psftp URL]

Edited by DaveF

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

You will find them in the help files for the Beta version.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

If you downloaded the beta installer there will be a beta help file at Programs | AutoIt3 | beta in the Start Menu.

The functions appear in the Functions | File, Directory and Disk Management Functions section.

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

If you have a console sftp client that will accept redirection of STDIN (not all console apps do, e.g. Win XP's telnet.exe) you can run it with StdinWrite and StdoutRead from the AutoIt beta release.

I see that PuTTY has a console sftp client.

Could you provide an example.

I'm also interested in the solution of about the same problem.

I tried as in documentation

$foo = Run ( "C:\putty.exe -load ABC","","",$STDERR_CHILD + $STDOUT_CHILD )
While 1
    $line = StdoutRead($foo)
    If @error = -1 Then ExitLoop
    MsgBox(0, "STDOUT read:", $line)
Wend

While 1
    $line = StderrRead($foo)
    If @error = -1 Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")

but I don't get a text

Edited by APRES
Link to comment
Share on other sites

Could you provide an example.

I'm also interested in the solution of about the same problem.

I tried as in documentation

$foo = Run ( "C:\putty.exe -load ABC","","",$STDERR_CHILD + $STDOUT_CHILD )
While 1
    $line = StdoutRead($foo)
    If @error = -1 Then ExitLoop
    MsgBox(0, "STDOUT read:", $line)
Wend

While 1
    $line = StderrRead($foo)
    If @error = -1 Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")

but I don't get a text

<{POST_SNAPBACK}>

I don't have access to a S-FTP server, but here is an example that runs on Windows 2000 or XP that demonstrates the concepts of using the functions.

I note in your code above that $STDERR_CHILD and $STDOUT_CHILD are used in the Run function, those don't have meaning unless you #include the Constants.au3 file as in the documentation. You can get the desired result by using the value 6 for the last argument, the help file docmentation for the Run function has details about this.

Also, PuTTY.exe is a Windows program, it won't create any output to the console. If you want to make a SSH connection with AutoIt managing the input and output you need to use PLink.exe from the PuTTY download page.

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...