webservice系列教学(5)-如何调用webservice(Jscript,vbscript)
2024-07-21 02:21:53
供稿:网友
4. 3 在asp中使用jscript调用
需下载mssoaptoolkit20.exe
引用:mssoap.soapclient
例程:
<%@ language = jscript %>
<html>
<head>
<title>webservice演示</title>
</head>
<body>
<%
var wsdl_url = "http://server0/yundan/webservice1.asmx?wsdl"
var a, b, res
var soapclient
a = 12
b = 13
soapclient = server.createobject("mssoap.soapclient")
soapclient.clientproperty("serverhttprequest") = true
‘在asp中运行 需要设置serverhttprequest选项
soapclient.mssoapinit("http://192.168.0.4/yundan/service1.wsdl","service1","service1soap","")
res = soapclient.test(2,3)
%>
<h3>webservice 演示</h3>
<b>result:</b> <%=res%><p><p>
</body>
</html>
4. 4在asp中使用vbscript调用
需下载mssoaptoolkit20.exe
引用:mssoap.soapclient
例程:
<%@ language = vbscript %>
<html>
<head>
<title>webservie演示</title>
</head>
<body>
<%
dim soapclient
const wsdl_url = "http://192.168.0.4/yundan/service1.wsdl"
set soapclient = server.createobject("mssoap.soapclient")
soapclient.clientproperty("serverhttprequest") = true
soapclient.mssoapinit
http://192.168.0.4:8080/yundan/service1.wsdl","service1","service1soap",""
dim res
res = soapclient.test(23, 34)
%>
<h1>webservie演示</h1>
<b>result:</b> <%=res%><p><p>
</body>
</html>