WebService series Teaching (5)-How to call WebService (Jscript,vbscript)

Source: Internet
Author: User
Tags wsdl
Js|jscript|vbscript|web 4. 3 using JScript calls in ASP
Need to download MsSoapToolkit20.exe
Reference: Mssoap.soapclient
Routines:
<%@ LANGUAGE = JScript%>
<HTML>
<HEAD>
<title>webservice Demo </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
' Running in ASP requires setting the ServerHTTPRequest option
Soapclient.mssoapinit ("Http://192.168.0.4/yundan/Service1.WSDL", "Service1", "Service1Soap", "")
res = soapclient.test (2,3)
%>
<B>Result:</B> <%=res%><P><P>
</BODY>
</HTML>
4.4 Use VBScript call in ASP
Need to download MsSoapToolkit20.exe
Reference: Mssoap.soapclient
Routines:
<%@ LANGUAGE = VBScript%>
<HTML>
<HEAD>
<title>webservie Demo </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)
%>
<B>Result:</B> <%=res%><P><P>
</BODY>
</HTML>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.