VB怎么调用WebService
1个回答
2013-07-11
展开全部
使用vb6.0调用需下载msSoapToolkit20.exe添加引用:Microsoft Soap Type Library 位置:”C:\Program Files\Common Files\MSSoap\Binaries\ MSSOAP1.dll” 调用方法: Dim cc As New MSSOAPLib.SoapClient 例程: 新建工程标准EXE添加3个textbox控件,text1,text2,text3添加一个button控件Command1 代码如下: Option ExplicitDim cc As New MSSOAPLib.SoapClientPrivate Sub Command1_Click()cc.mssoapinit " http://192.168.0.4/yundan/Service1.asmx?WSDL"Me.Text3.Text = cc.test(CInt(Text1.Text), CInt(Text2.Text))End Sub4.9使用vbscript调用需下载msSoapToolkit20.exe引用:MSSOAP.SoapClient 例程:Option ExplicitConst WSDL_URL = " http://192.168.0.4/yundan/service1.wsdl"WScript.echo "Connecting: " & WSDL_URLDim CalcSet Calc = CreateObject("MSSOAP.SoapClient")Calc.mssoapinit WSDL_URLDim AnswerAnswer = Calc.test(14,28)WScript.Echo "14+28=" & Answer将其存成domo.vbs文件,直接双击运行。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询