欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

在asp中使用Jscript调用webservices

程序员文章站 2022-03-10 18:04:38
需下载mssoaptoolkit20.exe引用:mssoap.soapclient    例程:    <%@ language...
需下载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>