利用ASP发送和接收XML数据的处理方法
来源:互联网 发布:中传在线网络登录 编辑:程序博客网 时间:2024/06/06 07:03
dim Https
set Https=server.createobject("MSXML2.XMLHTTP")
'定义一个XMLHTTP对像
Https.open "POST","http://127.0.0.1/testpost/response.asp",false
Https.send " echo 123456 987654 11111 22222 "
if Https.readystate=4 then
response.write "提交成功"
'readstate读取状态为4则成功,继续后面的,不成功当然就不用继续处理了
dim objstream
set objstream = Server.CreateObject("adodb.stream")
'定义一个stream,因为读过来的直接拿出来是乱码的,所以得处理一下
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write Https.responseBody
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
html = objstream.ReadText
'转好码,就放到html里,好关闭这些对像
objstream.Close
set objstream = nothing
set https=nothing
end if
response.write html
response.asp
'创建DOMDocument对象
Set xml = Server.CreateObject ("msxml2.DOMDocument")
xml.async = False
'装载POST数据
xml.Load Request
If xml.parseError.errorCode <> 0 Then
response.write "不能正确接收数据" & "Description: " & xml.parseError.reason & "<br>Line: " & xml.parseError.Line
End If
set blogchild=xml.getElementsByTagName("misc_command")
'the_text=blogchild.item(0).childnodes(1).text
'the_text=blogchild.item(0).text
'for i=0 to blogchild.length-1
response.write the_text
set Https=server.createobject("MSXML2.XMLHTTP")
'定义一个XMLHTTP对像
Https.open "POST","http://127.0.0.1/testpost/response.asp",false
Https.send " echo 123456 987654 11111 22222 "
if Https.readystate=4 then
response.write "提交成功"
'readstate读取状态为4则成功,继续后面的,不成功当然就不用继续处理了
dim objstream
set objstream = Server.CreateObject("adodb.stream")
'定义一个stream,因为读过来的直接拿出来是乱码的,所以得处理一下
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write Https.responseBody
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
html = objstream.ReadText
'转好码,就放到html里,好关闭这些对像
objstream.Close
set objstream = nothing
set https=nothing
end if
response.write html
response.asp
'创建DOMDocument对象
Set xml = Server.CreateObject ("msxml2.DOMDocument")
xml.async = False
'装载POST数据
xml.Load Request
If xml.parseError.errorCode <> 0 Then
response.write "不能正确接收数据" & "Description: " & xml.parseError.reason & "<br>Line: " & xml.parseError.Line
End If
set blogchild=xml.getElementsByTagName("misc_command")
'the_text=blogchild.item(0).childnodes(1).text
'the_text=blogchild.item(0).text
'for i=0 to blogchild.length-1
response.write the_text
- 利用ASP发送和接收XML数据的处理方法
- 利用ASP发送和接收XML数据的处理方法
- 利用ASP发送和接收XML数据的处理方法
- 利用ASP发送和接收XML数据的处理方法
- ASP发送和接收XML数据的处理方法
- UDP利用多线程实现数据的发送和接收
- 利用STM32 的串口来发送和接收数据实验
- ajax之xml数据的服务器端发送和客户端接收。
- PHP接收和发送XML数据
- 利用Jmail发送接收邮件的方法
- QTcpSocket 发送和接收数据的几种方法
- PHP CURL 发送和接收XML数据,并用$HTTP_RAW_POST_DATA接收
- Ajax 使用XMLHttpRequest对象发送数据和接收处理XML源代码
- C#网络Socket的数据发送与接收处理(利用异步)的模板(模式)
- xml文件的发送和接收
- asp.net利用Jmail发送邮件和接收全部代码
- 利用ASP从远程服务器上接收XML数据
- 利用ASP从远程服务器上接收XML数据
- 算法题目二:寻找最长重复子序列(4) 求给定字符串重复最长的子串
- Spring定义基本类型Bean
- 从程序员到项目经理(2):新任项目经理的误区
- 五大常用算法(一) 分治算法
- string对象与数值相互转换
- 利用ASP发送和接收XML数据的处理方法
- shell脚本实现无密码交互的SSH自动登陆
- 五大常用算法(一) 分治算法(1) 二分查找
- pcm音频合并噪音问题
- [5月2日的脚本] 核对 SQL Server加密证书不存在备份问题 (VBS)
- 如何让ajaxfileupload.js支持IE9,IE10,并可以传递多个参数?
- 五大常用算法(一) 分治算法(2) 大整数乘法
- HP-UX 主机巡检-nickel 脚本命令细细读--系统信息
- SPOJ GSS7 && Vijos1620 【LCT】