提交数据后如何取返回回来的结果

dushiluren 2007-05-16 08:49:25
我的一个页面提交数据到一个第3方的页面,结果返回如下:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <netdirect version="4.0">
<approval>no</approval>
<error>1002</error>
<custom_1 />
<custom_2 />
<custom_3 />
</netdirect>
请问我如何得到<approval>no</approval> 这里面的no并再指向自己的一个页面???
...全文
417 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
dushiluren 2007-05-17
  • 打赏
  • 举报
回复
我用xmlStream=req.responseText又可以取到文本但是数据都连在一起不好判断
dushiluren 2007-05-17
  • 打赏
  • 举报
回复
用xmlStream=req.responseXML.xml没报错了但是得到的xmlStream是空的,请问req.send(param)这里面的参数是干什么的
什么都不能 2007-05-17
  • 打赏
  • 举报
回复
用 xmlStream=req.responseXML.xml得到字符串
然后
set xmldoc=server.createObject("microsoft.XMLDom")
xmldoc.loadXML(xmlStream)
试一下
dushiluren 2007-05-17
  • 打赏
  • 举报
回复
set req=server.createObject("Microsoft.XMLHTTP")
dim url:url="https://www.nta-merchant.com/gateway/transfer/v1/member_to_merchant/index.cfm"
req.open "post",url,false
req.setRequestHeader "content-type","application/x-www-form-urlencoded"
req.send()
dim doc
doc=req.responseXML
approval=doc.selectSingleNode("//approval").text
response.write approval
上面的代码在doc=req.responseXML这一行老是报对象不支持此属性或方法的错误,请问为什么啊
dushiluren 2007-05-17
  • 打赏
  • 举报
回复
是对方写好的啊
dushiluren 2007-05-17
  • 打赏
  • 举报
回复
hanpoyangtitan(韩波洋) 再来指导下啊谢谢
dushiluren 2007-05-16
  • 打赏
  • 举报
回复
大侠们来指导一下啊
dushiluren 2007-05-16
  • 打赏
  • 举报
回复
str = request..... '得到XML
就是这个我不知道要在什么时候在哪去获取,我提交后它就返回那个XML了
dushiluren 2007-05-16
  • 打赏
  • 举报
回复
hanpoyangtitan(韩波洋)
microsoft.xmlhttp post提交,使用req.responseXML 得到返回的XML 数据流

请问要在什么时候创建microsoft.xmlhttp,什么时候在使用req.responseXML呢,最好有个例子谢谢了
chuckcoin 2007-05-16
  • 打赏
  • 举报
回复
比如
str = request..... '得到XML
Dim oXmlDom
Set oXmlDom = Server.CreateObject("Microsoft.XMLDOM")
oXmlDom.LoadXML(str)
Dim oNode
Set oNode = oXmlDom.getElementsByName("approval")(0)

Response.Write(oNode.text) '输出看看
什么都不能 2007-05-16
  • 打赏
  • 举报
回复
microsoft.xmlhttp post提交,使用req.responseXML 得到返回的XML 数据流
dushiluren 2007-05-16
  • 打赏
  • 举报
回复
还有个问题就是这是我提交后对方返回的页面,我要在什么地方去取这个数据呢
dushiluren 2007-05-16
  • 打赏
  • 举报
回复
能写个例子吗谢谢
chuckcoin 2007-05-16
  • 打赏
  • 举报
回复
create一个xmlDom对象,载入这个字符串,定位到approval,取到里面的text...
dushiluren 2007-05-16
  • 打赏
  • 举报
回复
顶一下,在线等
chuckcoin 2007-05-16
  • 打赏
  • 举报
回复
这么问吧,比如现在显示那个XML的页面叫result.asp,问:这个result.asp是你自己输出的,还是人家写好了你只能看?

dushiluren 2007-05-16
  • 打赏
  • 举报
回复
"<?xml version=""1.0"" encoding=""ISO-8859-1"" ?><netdirect version=""4.0""><approval>no</approval><error>1002</error><custom_1 /><custom_2 /><custom_3 /></netdirect>"这个内容是我提交到对方给的URL后对方直接显示给客户端的啊,我就是不想客户端显示这个XML想解析后显示自己的页面
dushiluren 2007-05-16
  • 打赏
  • 举报
回复
doc=req.responseXML这句报错了
Microsoft VBScript 运行时错误 (0x800A01B6)
对象不支持此属性或方法
为什么?
chuckcoin 2007-05-16
  • 打赏
  • 举报
回复
我例子里面的str是整个的xml字符串,相当于
str = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?><netdirect version=""4.0""><approval>no</approval><error>1002</error><custom_1 /><custom_2 /><custom_3 /></netdirect>"

就这个样子,不是已经取到里面的值了
什么都不能 2007-05-16
  • 打赏
  • 举报
回复
set req=server.createObject("microsoft.xmlhttp")
dim url:url="..."
dim param
param="xxxx="&request("username")&"&yyyy="&request("password")
req.open("post",url,false);
req.setRequestHeader("content-type","application/x-www-form-urlencoded")
req.send(param)
dim doc
doc=req.responseXML
approval=doc.selectSingleNode("//approval").text
response.write approval
加载更多回复(2)

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧