因为要做移动梦网WAP的一些接口,所以要用到这种方式,接下来会有ASP.net版本的,这个是ASP版本的,利用了MSXML2.XMLHTTP对像。
request.asp
dim Https
set Https=server.createobject("MSXML2.XMLHTTP")
'定义一个XMLHTTP对像
Https.open "POST","http://127.0.0.1/testpost/response.asp",false
Https.send "<?xml version=""1.0""?><misc_command version=""1.6""><command_name>echo</command_name>
<command_data_block><sid>123456</sid><service_id>987654</service_id>
<sp_id>11111</sp_id><sp_password>22222</sp_password></command_data_block></misc_command>"
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里调用Servlet或Web Service都是很轻松的!
猜你喜欢
- 介绍与创建型模式类似,工厂模式创建对象(视为工厂里的产品)时无需指定创建对象的具体类。工厂模式定义一个用于创建对象的接口,这个接口由子类决定
- Anaconda 是一个旗舰版的python安装包, 因为普通的python没有库, 如果需要安装一些重要的库, 要经常一个一个下载,会非常
- 一、简介Shp格式是GIS中非常重要的数据格式,主要在Arcgis中使用,但在进行很多基于网页的空间数据可视化时,通常只接受GeoJSON格
- mybatis数据库排序今天用到了对数据库按照倒序进行输出。因为刚接触mybatis,所以对这方面还不是太了解,再网上搜了好长时间终于找到了
- 在使用缓存时,容易发生缓存击穿。缓存击穿:一个存在的key,在缓存过期的瞬间,同时有大量的请求过来,造成所有请求都去读dB,这些请求都会击穿
- 1 简介本篇主要介绍使用pytorch实现基于CharRNN来进行文本分类与内容生成所需要的相关知识,并最终给出完整的实现代码。2 相关AP
- 直接将 视频的HTML网址存入models ,以字符串的形式#关于我们 CharFieldclass About(models.Model)
- 跨文件使用全局变量有多个py文件同时使用一个全局变量时,那应该如何使跨文件,用这个全局变量呢?1. 错误示范file1.py代码如下:num
- 问题:如何用ASP实现点击数统计?比如我要实现某篇文章被浏览一次就增加一个点击数,该怎么做?回答:就是说,比如,你的页面是:shownews
- 以去掉去掉<!--和-->为例进行说明:def clearContentWithSpecialCharacter(content
- 前言如果我们的应用在启动的时候需要对数据库进行初始化(比如建表等), 可以通过读取.sql文件内容直接执行. 但是, 这样会带出一个问题:在
- pycharm出现no module named xlwt问题首先声明,我是初学者,今天按照书上步骤,创建Excel文件,当我的xlwt安装
- 错误信息PS D:\parttime\python\django\guanxiangzhiji> python manage.py m
- 分离结构与表现的另一个重要方面是使用语义化的标记来构造文档内容。一个 XHTML 元素的存在就意味被标记内容的那部分有相应的结构化的意义,没
- 以下为测试例子。 1.首先创建两张临时表并录入测试数据: 代码如下:create table #temptest1 ( id i
- 在学会了SELECT语句的构造和用途之后你就该学习如何使用它了。在你所掌握的数据库工具下,这可能意味着你得按下某个写着“执行”字样的按钮。在
- usageerror: line magic function "%%time" not found在使用IPython
- 在Python 3.5(含)以前,字典是不能保证顺序的,键值对A先插入字典,键值对B后插入字典,但是当你打印字典的Keys列表时,你会发现B
- 实现代码# batch_handle_image.pyimport argparseimport globimport osfrom PIL
- go语言里边的字符串处理和PHP还有java 的处理是不一样的,首先申明字符串和修改字符串package mainimport "