views:

456

answers:

4

We have a financial product that has built in scheduling capabilities to run over night batches. This product can also use web services to kick off each batch as required.

I want to know if it is possible to call the web services from a .bat file or another type of batch/script file. If this is possible then we can call the batch file from the companies scheduling service (Autosys).

I don't want to write a exe to call this if possible (circumstances outside my control).

KISS approach :)

A: 

KISS Approach

in your bat file

iexplore.exe <url to webpage that consumes the webservice>

would that work ?

Andrew Keith
Hi Andrew, yes that may work. However wouldn't IE be left open after the call. Not the best solution as this is on a server that may not have anyone logging in for a week of two? Probably not as slick as I was hoping for.
John'o
A: 

If you're willing to install PowerShell 2 CTP it's supposed to be pretty easy.

EDIT: Wow, MS does not make it easy to find the right link! ;)

TrueWill
Sounds promising but working for a govt agency they tend to balk at pre-release versions being installed in a production environment.
John'o
@John'o - you won't have long to wait. PowerShell 2's shipping with Windows 7, and a download for use with older OS's is supposed to follow.
TrueWill
A: 

IMHO, KISS demands that you not use a scripting language that has no built-in web service support. Anything you do in that language will complicate things just to provide the missing capability.

KISS says create a console application in Visual Studio, add a Service Reference, call the necessary method, then run the console application in your .bat file. .bat files have built-in support for running console applications.

John Saunders
Hi John, "IMHO, KISS demands that you not use a scripting language that has no built-in web service support". I did mention "... from a .bat file or another type of batch/script file". :)
John'o
Yes, but I thought you supplied "KISS" as the reason. I responded that this would not be the simplest way to call a web service in a scripted manner. Calling the service from a console application, which is, in turn, called by the script, would be the simplest.
John Saunders
The problem with your answer is in the original question, "I don't want to write a exe to call this if possible (circumstances outside my control)". So I was really looking for a script to do the job. Anyway thanks for the feedback.
John'o
+1  A: 

Hi All I found the answer if anyone else is looking to do the same thing. The following link has an example using a .vb script to call the WS.

http://blogs.msdn.com/bgroth/archive/2004/10/21/246155.aspx

John'o