VB6.0调用WSDL
麻烦高手给写一个调用【http://218.19.216.186/services/platformIter?wsdl】里面的TestFun方法:
我这样写是报错的:不知道错在哪里?
Dim sc As New MSSOAPLib.SoapClient
Dim F上传标志 As Boolean
sc.mssoapinit "http://192.168.17.197/services/platformIter?wsdl"
F上传标志 = sc.deleteTerminal("123")
希望贴代码,谢谢!
[解决办法]
调用webservice(vb6.0,vbscript)
点击: 发布日期:2007-4-19 8:14:00 进入论坛
4.8使用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 Explicit
Dim cc As New MSSOAPLib.SoapClient
Private 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 Sub
4.9使用vbscript调用
需下载msSoapToolkit20.exe
引用:MSSOAP.SoapClient
例程:
Option Explicit
Const WSDL_URL = "http://192.168.0.4/yundan/service1.wsdl"
WScript.echo "Connecting: " & WSDL_URL
Dim Calc
Set Calc = CreateObject("MSSOAP.SoapClient")
Calc.mssoapinit WSDL_URL
Dim Answer
Answer = Calc.test(14,28)
WScript.Echo "14+28=" & Answer
将其存成domo.vbs文件,直接双击运行。
本文来自: 中国自学编程网(www.zxbc.cn) 详细出处参考:http://www.zxbc.cn/html/20090802/72465.html