The default. asp file is saved below
<! -- # Include file = "Conn. ASP "--> <% REM --------------------------------------------- REM file name: syncorderrelationreq. asprem function: parse the xml of the post request and check the processing result by rem msn: REM ----------------------------------------------- %> <% function writelog (STR) dim OFS, ofile, m_tempispath = "out_syncorderrelationreq.txt" set OFS = server. createobject ("scripting. fileSystemObject ") sfilename = server. mappath (Spath) set ofile = ofs. opent Extfile (sfilename, 8, true) ofile. writeline strset OFS = nothingend function %> <% response. contenttype = "text/XML" response. charset = "UTF-8" dim receiveddoc, oresponsedomwritelog "Synchro request begin" 'set receiveddoc = server for Synchronous requests. createobject ("msxml2.domdocument") receiveddoc. async = false' whether to synchronize receiveddoc. load request 'get post request '///////////////////////////////// // If (receiveddoc. parseerror. errorcode <> 0) then set myerr = receiveddoc. parseerrorset oresponsesoapbody = oresponsedom. selectsinglenode ("// syncorderrelationresp") oresponsesoapbody. selectsinglenode ("HRET "). TEXT = "9014" 'cannot parse the soap and XML structure oresponsedom. save (response) writelog "have error" & myerr. reason 'response. end () end ifif receiveddoc. childnodes. length = 0 thenset oresponsesoapbody = oresponsedom. selectsinglenode ("// syncorderrelationresp") Oresponsesoapbody. selectsinglenode ("HRET"). Text = "9014" oresponsedom. Save (response) writelog "cannot parse the soap and XML structures. "'Response. end () end if '///////////////////////////////////// /'Get the XML document A = receiveddoc from post. selectsinglenode ("// transactionid "). text writelog "transactionid =" & a' message No. B = receiveddoc. selectsinglenode ("// version "). textwritelog "version =" & B 'version of the interface message c = receiveddoc. selectsinglenode ("// msgtype "). textwritelog "msgtype =" & C' Message Type D = receiveddoc. selectsinglenode ("// send_address/devicetype "). textwritelog "Dev Icetype = "& De = receiveddoc. selectsinglenode ("// send_address/DeviceID "). textwritelog "DeviceID =" & EF = receiveddoc. selectsinglenode ("// dest_address/devicetype "). textwritelog "devicetype =" & fg = receiveddoc. selectsinglenode ("// dest_address/DeviceID "). textwritelog "DeviceID =" & g h = receiveddoc. selectsinglenode ("// feeuser_id/useridtype "). textwritelog "useridtype =" & HI = receiveddoc. selectsinglenode ("// feeuse R_id/msisdn "). textwritelog "msisdn =" & ij = receiveddoc. selectsinglenode ("// feeuser_id/Pseudo Code "). textwritelog "pseudo docode =" & JK = receiveddoc. selectsinglenode ("// destuser_id/useridtype "). textwritelog "useridtype =" & KL = receiveddoc. selectsinglenode ("// destuser_id/msisdn "). textwritelog "msisdn =" & lm = receiveddoc. selectsinglenode ("// destuser_id/Pseudo Code "). textwritelog "pseudo docode =" & Mn = receiveddoc. sel Ectsinglenode ("// linkid "). textwritelog "linkid =" & NO = receiveddoc. selectsinglenode ("// actionid "). textwritelog "actionid =" & OP = receiveddoc. selectsinglenode ("// actionreasonid "). textwritelog "actionreasonid =" & PQ = receiveddoc. selectsinglenode ("// spid "). textwritelog "spid =" & QR = receiveddoc. selectsinglenode ("// spserviceid "). textwritelog "spserviceid =" & rs = receiveddoc. selectsinglenode ("// accessmode "). text Writelog "accessmode =" & St = receiveddoc. selectsinglenode ("// featurestr "). textwritelog "featurestr =" & T set inclueddoc = nothing writelog "End of synchronization request" & now () writelog "" If nret <> 0 then' REM --------- error handling interface nret = 1 writelog "An error occurred while synchronizing the forward order relationship" & now () else 'rem --------- correct returned results SQL = "select * From tb_test where I = '" & I & "' and r = '" & R & "'" Rs. open SQL, Conn, 1, 3if (RS. EOF and Rs. bof) then' does not exist in the same business code with the same number if o = 1 thenlogout = "0" Log Indate = now () rs. addnew' add RS ("logindate") = logindaters ("logout") = logoutrs ("A") = ARS ("B") = BRS ("C ") = CRS ("D") = drs ("e") = ERS ("F") = FR ("G") = GRs ("H ") = hrs ("I") = IRS ("J") = JRS ("K") = KRS ("L") = LRS ("M ") = Mrs ("N") = NRS ("O") = Ors ("p") = PRS ("Q") = QRS ("R ") = RRS ("S") = SRS ("T") = TRS. the updateend ifelse number exists if o = 2 or O = 4 thenlogout = "1" logoutdate = now () RS ("logout") = logoutrs ("logoutdate") = logoutdaters. updateelselogout = "0" RS ("logout") = L Ogoutrs. updateend if end if RS. closeset rs = nothingconn. closeset conn = nothingend ifnret = 0 writelog "Synchronous Response Start" set oresponsedom = server. createobject ("msxml2.domdocument") oresponsedom. async = false' whether to synchronize oresponsedom. load (server. mappath ("syncorderrelationresp. XML ") 'gets the response format oresponsedom. selectsinglenode ("// transactionid "). TEXT = awritelog "transactionid =" & A oresponsedom. selectsinglenode ("// HRET "). TEXT = N Retwritelog "HRET =" & nret '-------------------------------------- return XML. Oresponsedom. save (response) set oresponsedom = nothingwritelog "End of Synchronous Response" writelog "====================== ====== "writelog" "writelog" "%>
Connect to the database file conn. asp
<% dim conn,strconnstrconn ="Provider=SQLOLEDB;DATABASE=Provider;Persist Security Info=True;UID=sa;PWD=owen;Data Source=127.0.0.1"set conn = server.createobject("adodb.connection")conn.open strconnset rs=server.createobject("adodb.recordset")%>
Create the following table in SQL:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_test]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[tb_test]GOCREATE TABLE [dbo].[tb_test] ([id] [decimal](18, 0) IDENTITY (1, 1) NOT NULL ,[logindate] [datetime] NULL ,[logout] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[logoutdate] [datetime] NULL ,[a] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[b] [text] COLLATE Chinese_PRC_CI_AS NULL ,[c] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[d] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[e] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[f] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[g] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[h] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[i] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[j] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[k] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[l] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[m] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[n] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[o] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[p] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[q] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[r] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[s] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,[t] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO
Create the file named out_syncorderrelationreq.txt in the same directory.
Create the following syncorderrelationresp. xml file:
<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><TransactionID xmlns="http://www.monternet.com/dsmp/schemas/"></TransactionID></SOAP-ENV:Header><SOAP-ENV:Body><SyncOrderRelationResp xmlns="http://www.monternet.com/dsmp/schemas/"><Version>1.5.0</Version><MsgType>SyncOrderRelationResp</MsgType>