Asp+|xml
Interface XML
file format <info> <rec> <depID>Belongs column </depID> <smallClassID>Owning Information Unit </smallClassID> <type>Information Release Form </type> <keyWord>Key words </keyWord> <title>News Headlines </title> <author>Author </author> <original>Original source </original> <content>News content </content> </rec> <rec> <depID>Belongs column </depID> <smallClassID>Owning Information Unit </smallClassID> <type>Information Release Form </type> <keyWord>Key words </keyWord> <title>News Headlines </title> <author>Author </author> <original>Original source </original> <content>News content </content> </rec> </info>
Note:
interface type and data considerations.
field name |
name |
Type |
data value Description |
upload Data description |
Depid |
Belongs column |
Int (4) |
|
Code (cannot be empty) |
Smallclassid |
Owning Information Unit |
Nvarchar (25) |
|
Code (cannot be empty) |
type |
information publishing form |
nvarchar (7) |
< Font size= "3" > Important information =1 pop-up message =2 hotspot information =3 check multiple to "," delimited such as: 1,2,3 |
code (multiple comma separated) |
keyword |
keyword |
nvarchar (m) |
such as: keyword1,keyowrd2 |
text (multiple comma separated) |
Title |
News Headlines |
Nvarchar (50) |
Text |
Text (cannot be empty) |
Author |
Author |
Nvarchar (20) |
Text |
Text |
Original |
Original source |
Nvarchar (20) |
Text |
Text |
Content |
News content |
VarChar (4000) |
Text |
Text (cannot be empty) |
For
Example:
<info> <rec> <depID>1</depID> <smallClassID>20040212200856429814</smallClassID> <type>1,3</type> <keyWord>Key words 1,Key words 2</keyWord> <title>News Headlines </title> <author>Author </author> <original>Original source </original> <content>News content </content> </rec> </info>
Upload Method Description:
sends the resulting string to the
http://
server IP
:
Port
/receiveinfo.asp (
must be delivered by
POST
)
tested by code as follows:
send end:
sendinfo.asp
<%
set Xmlhttp=server.createobject ("MSXML2. ServerXMLHTTP ")
xmlstr= "<info><rec><depid>1</depid><smallclassid>20040212200856429814 </smallClassID><type>1,3</type><keyWord>
keyword
1,
keyword
2 </keyWord><title>
News title
</title><author>
author
</ author><original>
Original source
</original><content>
news 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 <> "then"
Response.Write "<font style= ' font-size:12px;color:red ' >
status
:" &xmlhttp.stat us& ";
Description
: "&xmlHttp.ResponseText&" </font> "
Else
Response.Write "<font style= ' font-size:12px;color:red ' >" &xmlHttp.ResponseText& "</fon T> "
End If
Else
Response.Write "<font style= ' font-size:12px;color:red ' >
status
:" &xmlhttp.status& amp; ";
Description
: "&xmlHttp.ResponseText&" </font> "
End If
%>
receiving end:
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")
%>