分享

ASP调用WebService的一种方法 | 波斯马

 飞鹰飞龙飞天 2014-07-17
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<%
'定义参数
dim name,password
'依次为WebService的服务器地址、文件名称、方法接口
url = "http://192.168.10.1/Email.asmx/EmailSend"
'传递参数,如果包含&,需要使用%26进行替换
SoapRequest="name=name&password=password"
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open "POST",url,false
xmlhttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
xmlhttp.setRequestHeader "HOST","192.168.10.1"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.Send(SoapRequest)
'显示结果,如果成功显示:200 OK
Response.Write xmlhttp.Status & " "
Response.Write xmlhttp.StatusText
Set xmlhttp = Nothing
%>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多