接口文件格式说明(asp+xmlhttp)
来源:互联网 发布:qq飞车迈凯轮数据 编辑:程序博客网 时间:2024/05/02 02:13
接口xml文件格式
<info>
<rec>
<depID>所属栏目</depID>
<smallClassID>所属信息单位</smallClassID>
<type>信息发布形式</type>
<keyWord>关键字</keyWord>
<title>新闻标题</title>
<author>作者</author>
<original>原出处</original>
<content>新闻内容</content>
</rec>
<rec>
<depID>所属栏目</depID>
<smallClassID>所属信息单位</smallClassID>
<type>信息发布形式</type>
<keyWord>关键字</keyWord>
<title>新闻标题</title>
<author>作者</author>
<original>原出处</original>
<content>新闻内容</content>
</rec>
</info>
注:接口类型和数据注意事项。
字段名
名称
类型
数据取值说明
上传数据说明
depID
所属栏目
Int(4)
代码(不能为空)
smallClassID
所属信息单位
Nvarchar(25)
代码(不能为空)
type
信息发布形式
Nvarchar(7)
重要信息=1
弹出信息=2
热点信息=3
可复选多个,以“,”分隔
如:1,2,3
代码(多个用逗号分隔)
keyWord
关键字
Nvarchar(50)
多个以“,”分隔
如:keyword1,keyowrd2
文字(多个用逗号分隔)
title
新闻标题
Nvarchar(50)
文字
文字(不能为空)
author
作者
Nvarchar(20)
文字
文字
original
原出处
Nvarchar(20)
文字
文字
content
新闻内容
varChar (4000)
文字
文字(不能为空)
举例:
<info>
<rec>
<depID>1</depID>
<smallClassID>20040212200856429814</smallClassID>
<type>1,3</type>
<keyWord>关键字1, 关键字2</keyWord>
<title>新闻标题</title>
<author>作者</author>
<original>原出处</original>
<content>新闻内容</content>
</rec>
</info>
上传方法说明:
将上述产生的字符串发送到http://服务器IP:端口/receiveInfo.asp(必须用POST方式传送)
经测试通过代码如下:
发送端:sendInfo.asp
<%
set xmlhttp=Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlstr="<info><rec><depID>1</depID><smallClassID>20040212200856429814</smallClassID><type>1,3</type><keyWord>关键字1, 关键字2</keyWord><title>新闻标题</title><author>作者</author><original>原出处</original><content>新闻内容</content></rec></info>"
URL="http://192.168.1.5:9020/receiveInfo.asp"
xmlhttp.open "POST",URL, False
xmlhttp.send xmlstr
if err.number=0 then
if xmlhttp.status <>"200" then
Response.Write "<font style='font-size:12px;color:red'>状态:"&xmlhttp.status&" ;描述:"&xmlHttp.ResponseText&"</font>"
else
Response.Write "<font style='font-size:12px;color:red'> "&xmlHttp.ResponseText&"</font>"
end if
else
Response.Write "<font style='font-size:12px;color:red'>状态:"&xmlhttp.status&" ;描述:"&xmlHttp.ResponseText&"</font>"
end if
%>
接收端:receiveInfo.asp
<%@codepage=936%>
<%
Server.ScriptTimeOut=99999
Response.Buffer =false
Response.CharSet="gb2312"
set xmldoc=Server.CreateObject("MSXML2.DOMDocument")
xmldoc.load Request
set root = xmldoc.DocumentElement
for i=1 to xmldoc.documentelement.childNodes.length
Set recnote = xmldoc.documentelement.childNodes(i-1)
Set depIDnote = recnote.selectSingleNode("depID")
Set smallClassIDnote = recnote.selectSingleNode("smallClassID")
Set typenote = recnote.selectSingleNode("type")
Set keyWordnote = recnote.selectSingleNode("keyWord")
Set titlenote = recnote.selectSingleNode("title")
Set authornote = recnote.selectSingleNode("author")
Set originalnote = recnote.selectSingleNode("original")
Set contentnote = recnote.selectSingleNode("content")
response.Write depIDnote.text&"||"
response.Write smallClassIDnote.text&"||"
response.Write typenote.text&"||"
response.Write keyWordnote.text&"||"
response.Write titlenote.text&"||"
response.Write authornote.text&"||"
response.Write originalnote.text&"||"
response.Write contentnote.text&"||"
next
response.Write("0")
%>
- 接口文件格式说明(asp+xmlhttp)
- xmlhttp说明文档
- XmlHttp+ASP异步调用
- asp xmlHttp用法举例
- asp xmlhttp adodb.stream
- 文件格式及说明
- 。INF文件格式说明
- 。INF文件格式说明
- .INF文件格式说明
- 文件格式及说明
- 文件格式及说明
- Ant build 文件格式说明
- USGS DEM文件格式说明
- BMP 文件格式说明
- ply文件格式详细说明
- jpgw文件格式说明
- Intel Hex文件格式说明
- 【转】INF文件格式说明
- ASP.NET 2.0:弃用 DataGrid 吧,有新的网格控件了!
- 网盾工程
- 找到的在系统托盘上的冒泡提示框的代码,看来有点效果
- GridCtrl控件的使用
- Sql Server 经典网站
- 接口文件格式说明(asp+xmlhttp)
- XML在自动收费系统票价表设计中的应用
- Ioc容器的革命性优点
- Windows Mobile BLOG 问题集锦 2006-9-25
- 直接插入排序
- 如果是这样的话.我在调用时就出现这种情况
- 思我想思的朋友,念我想念的人
- 从文件中读取文本信息
- Hibernate in Spring