没有合适的资源?快使用搜索试试~ 我知道了~
APS调用WEBservice方法详解
需积分: 10 3 下载量 65 浏览量
2015-02-16
08:05:11
上传
评论
收藏 2KB TXT 举报
温馨提示
试读
2页
APS调用WEBservice方法详解已经通过测试,可以放心使用。
资源推荐
资源详情
资源评论
<%
1、定义WEBservice的地址。
url = "http://110.10.9.135:8889/Service.asmx"
2、获得网址传过来的数据组
bkh=Request.QueryString("bkh")
num=Request.QueryString("num")
types=Request.QueryString("type")
3、这里需要根据webservice里的内容进行填写。
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>"&"<GetImg xmlns="&CHR(34)&"http://myservice/"&CHR(34)&">"&"<bkh>"&bkh&"</bkh>"&"<num>"&num&"</num>"&"<type>"&types&"</type>"&"</GetImg>"&"</soap:Body>"& "</soap:Envelope>"
4、创建一个XML的接收器
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
5、这个有没有都可以,与4相同。
Set xmlDOC =Server.CreateObject( "MSXML.DOMDocument")
6、通过Msxml2.XMLHTTP打开
xmlhttp.Open "POST",url,false
7、需要根据webservice里的内容进行填写。
xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
xmlhttp.setRequestHeader "HOST","110.10.9.135"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "http://myservice/GetImg"
8、发送
xmlhttp.Send(SoapRequest)
9、如果没有5,这个也没有
bOK = xmlDOC.load(xmlhttp.responseXML)
10、判断状态200是通过,500是没有通过
if xmlhttp.Status=200 then
xmlStr = xmlDOC.xml
Response.Write "A1:" & xmlhttp.Status & " <br> "
Response.Write "A2:" & xmlhttp.StatusText & " <br> "
1、定义WEBservice的地址。
url = "http://110.10.9.135:8889/Service.asmx"
2、获得网址传过来的数据组
bkh=Request.QueryString("bkh")
num=Request.QueryString("num")
types=Request.QueryString("type")
3、这里需要根据webservice里的内容进行填写。
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>"&"<GetImg xmlns="&CHR(34)&"http://myservice/"&CHR(34)&">"&"<bkh>"&bkh&"</bkh>"&"<num>"&num&"</num>"&"<type>"&types&"</type>"&"</GetImg>"&"</soap:Body>"& "</soap:Envelope>"
4、创建一个XML的接收器
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
5、这个有没有都可以,与4相同。
Set xmlDOC =Server.CreateObject( "MSXML.DOMDocument")
6、通过Msxml2.XMLHTTP打开
xmlhttp.Open "POST",url,false
7、需要根据webservice里的内容进行填写。
xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
xmlhttp.setRequestHeader "HOST","110.10.9.135"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "http://myservice/GetImg"
8、发送
xmlhttp.Send(SoapRequest)
9、如果没有5,这个也没有
bOK = xmlDOC.load(xmlhttp.responseXML)
10、判断状态200是通过,500是没有通过
if xmlhttp.Status=200 then
xmlStr = xmlDOC.xml
Response.Write "A1:" & xmlhttp.Status & " <br> "
Response.Write "A2:" & xmlhttp.StatusText & " <br> "
资源评论
guogang3411
- 粉丝: 10
- 资源: 48
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功