How to submit files from the command line without TN

I am currently working in a POC (proof of concept) to analyze how to submit files to webMethods IS 4.6 without going thru TN. I have two options so far, create a java class to work as client and use it to submit files (I have done that successfully), or I could create a CGI script to do that.

My question is: do you have any example of CGI script and BAT (MS-DOS) script capable of invoking a webMethods services (example: http://localhost:5555/invoke/wm.tn/receive) from the command line? I also need one example of Unix script to do the same.

Your help is greatly appreciated!

Thanks,

Waldes

I have used MSDOS batch files to do FTP’s to webMethods services. What I usually do is create a batch file that references a login script as shown below:

Batch File contents:

ftp -s:“C:\Work Folder\FTPFlatFile.txt”

FTPFlatFile.txt contents (used as the login script):

open development.domain.net 6000
<username>
<password>
cd /ns/FTP/receiveFlatFile
put FlatFile.txt
quit

Ok, this seems to be a FTP alternative. But I am looking for a HTTP/S alternative and I wonder how to HTTP POST a file from the command line using a regular BAT script (MS-DOS) or an Unix script. Any ideas???

ps: Daniel Rivera, thx for taking the time to reply, it helped as well.

Does anyone have any example of a script to submit documents to a webMethods service bypassing TN? I need examples in CGI, PERL and if possible in BAT (MS-DOS/Windows command line batch scripts). I am working on a POC (proof of concept). Your help is greatly appreciated!

Thanks,

Waldes

Hi Waldes,

You can write a service to receive and process the document and post the document via http/https directly to this service (http://localhost:5555/invoke/folder/service, or something like this). It worked to me.
Don´t forget to set the correct ACL to the service.

HTH.
Maldonado

I have been sucessfull to submit files with HTML (using POST) and with a java client. I am looking for other cheaper and less troubled options like a nice and easy BAT script (MS-DOS/Windows) or a Unix script, or PERL, CGI. My goal is to submit a XML file from the command line in MS-DOS and Unix. Can anybody help? I need examples in BAT and CGI if possible. Thanks!

I found a conservative way to do this without much hassle: HTML POST. I got a good example from a friend of a HTML page that allows the user to pick up a file locally and pass it to a PERL script in order to get the file processed (no webMethods involved).

I successfully uploaded this HTML page in webMethods and it works the same way a regular DSP does!

My question now is, how can I run a PERL script from within a DSP page? The PERL script is residing in the same webMethods pub directory (…/IntegrationServer4/packages/<mypackagename>/pub) where the HTML/DSP pages are residing.

Any ideas? Does anyone had do run a PERL or CGI script from a DSP page before? Suggestions are welcome.

Thanks,

Waldes

as I understand, you want to run something at server side in DSP page? i think only thing that works in that way is a DSP.

if you are looking at something on clientside… you have options of using whatever your browser supports.

Chirag.

Let me see if I can be more clear and keep it concise:

What I am trying to do is to upload a file from my local hard drive (laptop/desktop) to my webMethods server.

Well, the DSP page is ready and it works like a charge (I am able to click a button and select the local file I am interested to upload), but when I call the PERL/CGI script it craps out! Instead of running the script (which will copy the file from my local directory to my server) the script is displayed on the screen.

My question continues to be: how can I run a PERL/CGI script from within a DSP page?

Note: I know that I could invoke a webMethods to do the same, and I have thought about that already. But this is a POC (proof of concept) and I need to try different alternatives and measure the efficiency before taking the final decision.

Suggestions are welcome!

Thanks,

Waldes