从脚本或批处理文件调用web服务

时间:2022-01-05 02:19:23

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.

我们有一种财务产品,它建立在调度能力上,可以在夜间批量运行。该产品还可以使用web服务根据需要启动每个批处理。

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

我想知道是否可以从.bat文件或其他类型的批处理/脚本文件调用web服务。如果这是可能的,那么我们可以从公司调度服务(Autosys)调用批处理文件。

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

如果可能的话,我不想写一个exe调用它(在我无法控制的情况下)。

KISS approach :)

方法:吻)

4 个解决方案

#1


5  

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

这是对使用微软的John'o的回答。XmlHttp(应该已经存在于服务器\工作站上)

Create a .vbs a

创建一个.vbs

Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", "http://www.webservicex.net/stockquote.asmx?WSDL", FALSE
http.send ""
WScript.Echo http.responseText

#2


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.

嗨,我找到了答案,如果有人想做同样的事。下面的链接有一个使用.vb脚本调用WS的例子。

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

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

#3


0  

KISS Approach

接吻的方法

in your bat file

bat文件中

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

would that work ?

会工作吗?

#4


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要求您不要使用没有内置web服务支持的脚本语言。你用那种语言做的任何事情都会使事情变得复杂,只为了提供缺失的功能。

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.

KISS说在Visual Studio中创建一个控制台应用程序,添加一个服务引用,调用必要的方法,然后在.bat文件中运行控制台应用程序。

#1


5  

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

这是对使用微软的John'o的回答。XmlHttp(应该已经存在于服务器\工作站上)

Create a .vbs a

创建一个.vbs

Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", "http://www.webservicex.net/stockquote.asmx?WSDL", FALSE
http.send ""
WScript.Echo http.responseText

#2


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.

嗨,我找到了答案,如果有人想做同样的事。下面的链接有一个使用.vb脚本调用WS的例子。

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

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

#3


0  

KISS Approach

接吻的方法

in your bat file

bat文件中

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

would that work ?

会工作吗?

#4


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要求您不要使用没有内置web服务支持的脚本语言。你用那种语言做的任何事情都会使事情变得复杂,只为了提供缺失的功能。

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.

KISS说在Visual Studio中创建一个控制台应用程序,添加一个服务引用,调用必要的方法,然后在.bat文件中运行控制台应用程序。