欢迎光临
我们一直在努力

webservice系列教学(9)-如何调用webservice(vb6.0,vbscript)-.NET教程,Web Service开发

建站超值云服务器,限时71元/月

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文件,直接双击运行。

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » webservice系列教学(9)-如何调用webservice(vb6.0,vbscript)-.NET教程,Web Service开发
分享到: 更多 (0)