6

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 :)

4 Answers 4

7

This is a take on John'o's answer that uses Microsoft.XmlHttp (which should already exist on the server\workstation)

Create a .vbs a

Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", "http://www.webservicex.net/stockquote.asmx?WSDL", FALSE
http.send ""
WScript.Echo http.responseText
Sign up to request clarification or add additional context in comments.

1 Comment

How to handle https URLs?
3

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

1 Comment

It's also possible to build the SOAP message by hand and parse the result, rgagnon.com/wshdetails/wsh-0033.html
0

KISS Approach

in your bat file

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

would that work ?

1 Comment

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

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.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.