Foxtable(狐表)用户栏目专家坐堂 → 关于webservers发送短信的问题


  共有3643人关注过本帖平板打印复制链接

主题:关于webservers发送短信的问题

帅哥哟,离线,有人找我吗?
chenjiu6202
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:403 积分:3886 威望:0 精华:0 注册:2013/1/18 21:38:00
关于webservers发送短信的问题  发帖心情 Post By:2016/1/9 14:24:00 [只看该作者]

我想利用webservers接口进行第三方短信发送,
厂家给我发来一个API说明和Asp.net的一个实例,一头雾水不知从何下手,
诚恳请哪位老师给我说一说,帮帮我!先表示感谢!下面是那个实例的一部分
<%
url = "http://service2.winic.org/Service.asmx"  'webservice 地址

'==============================查询账户信息
function GetUserInfo(uid,pwd)
SoapRequest="<?xml version="&CHR(34)&"1.0"&CHR(34)&" encoding="&CHR(34)&"utf-8"&CHR(34)&"?>"& _
"<soap:Envelope xmlns:xsi="&CHR(34)&"http://www.w3.org/2001/XMLSchema-instance"&CHR(34)&" "& _
"xmlns:xsd="&CHR(34)&"http://www.w3.org/2001/XMLSchema"&CHR(34)&" "& _
"xmlns:soap="&CHR(34)&"http://schemas.xmlsoap.org/soap/envelope/"&CHR(34)&">"& _
"<soap:Body>"& _
"<GetUserInfo xmlns="&CHR(34)&"http://tempuri.org/"&CHR(34)&">"& _
"<uid>"&uid&"</uid>"& _
"<pwd>"&pwd&"</pwd>"& _
"</GetUserInfo>"& _
"</soap:Body>"& _
"</soap:Envelope>"

Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open "POST",url,false
xmlhttp.setRequestHeader "Content-Type", "text/xml;charset=utf-8"
xmlhttp.setRequestHeader "HOST","service2.winic.org"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "http://tempuri.org/GetUserInfo" '一定要与WEBSERVICE的命名空间相同,否则服务会拒绝
xmlhttp.Send(SoapRequest)
''样就利用XMLHTTP成功发送了与SOAP示例所符的SOAP请求.'检测一下是否返回200=成功: 
     If xmlhttp.Status = 200 Then
        Set xmlDOC = server.CreateObject("MSXML.DOMDocument")
        xmlDOC.load(xmlhttp.responseXML)
            GetUserInfo=xmlDOC.documentElement.selectNodes("//GetUserInfoResult")(0).text '显示节点为GetUserInfoResult的数据(返回字符串)
        Set xmlDOC = nothing
    Else
        GetUserInfo=xmlhttp.Status&"&nbsp;"
        GetUserInfo=xmlhttp.StatusText
    End if
        Set xmlhttp = Nothing
end function

 回到顶部
总数 15 1 2 下一页