首页 > 开发 > 综合 > 正文

webservice系列教学(9)-如何调用webservice(vb6.0,vbscript)

2024-07-21 02:21:46
字体:
来源:转载
供稿:网友
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文件,直接双击运行。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表