Using HTTPService Pseudo-Web Services Communications for ASP, complete database operation I offer an ASP's pseudo-service ideology: ClientReq.xml: ---------------------------------------------------------------------------------------------- -------------------------------------------------- ----------------------- XML Version = "1.0" encoding = "gb2312"?> getValueReq msgtype> < Version> 1.0 version> testpacket> Index.mxml: --------------------------------- -------------------------------------------------- ------------ {mreq} xml> mx: request> mx: Httpservice> TestServer.asp: -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- --- Mainly have data packets, parsing packets, specifying operations, returning data four steps 1. Get submitted packets set = server.createObject ("msxml2.domdocument") odom.load request 2. Parsing the data packet, to obtain MsgTypesMsgType = Trim (oDom.selectSingleNode ( "// MsgType"). Text) Select Case sMsgTypeCase "GetvalueReq" Call Getvalue'Case "DeletevalueReq" 'Call DeletevalueCase "InsertvalueReq"' Call Insertvalue (oDom) 'Case " UpdateValuereq "'CALL UPDATEVALUE'ELSE CASE' CALL SHOWERRMSGEND SELECT 3.
Specify the operation, complete the getValue operation, there are many of which can be made into public modules for other functions to use sconn = "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & server.mAppath ("message.mdb ") Set oconn = server.createObject (" adodb.connection ") Oconn.open sconnsql =" select * from message order by id "set = server.createObject (" adodb.recordset ") Ors.Open SSQL, Oconn, 1, 1 'Construction No record XML Document If ory = " Xml version =" "1.0" "Encoding =" "GB2312" "" "?>" & VBCRLF & _ " & vbcrlf & _ SystemResp msgtype> "& vbcrlf & _" 1.0 version> "& vbcrf & _" 0 result> "& vbcrlf & _" testpacket> "endiff) There is a record XML document if not (ors.eof and ors.bof) Thendo while not list.eofstmpxml = stmpxml & " "& ics (" name ") &" name> "& VBCRLF & _" "& ORS (" Age ") &" AGE> "& VBCRLF & _" "& ORS (" SEX ") &" sex> "& vbcrf & _ < Msg> "& ORS (" MSG ") &" msg> "& vbrlf & _" message "" & vbrlfors.movenextloopsXML = " "& VBCRLF & _ & Vbcrlf & _ " SystemResp msgtype>" & vbcrlf & _ "<