Request.asp
| Dim Https Set Https=server.createobject ("MSXML2. XMLHTTP ") ' Define a XMLHTTP pair like Https.open "POST", "http://127.0.0.1/testpost/response.asp", False Https.send "Echo 123456 987654 11111 22222 " If Https.readystate=4 Then Response.Write "submitted successfully" ' ReadState read status is 4 successful, continue behind, unsuccessful, of course, there is no need to continue processing Dim objstream Set objstream = Server.CreateObject ("ADODB.stream") ' Define a stream, because read it directly out of the garbled, so have to deal with Objstream. Type = 1 Objstream. Mode =3 Objstream. Open Objstream. Write Https.responsebody Objstream. Position = 0 Objstream. Type = 2 Objstream. Charset = "GB2312" html = objstream. ReadText ' Turn your code, put it in the HTML, and close these pairs. Objstream. Close Set objstream = Nothing Set https=nothing End If Response.Write html Response.asp ' Create a DOMDocument object Set XML = Server.CreateObject ("MSXML2.") DOMDocument ") Xml.async = False ' Load post data Xml. Load Request If xml.parseError.errorCode <> 0 Then Response.Write "cannot receive data correctly" & Description: "& Xml.parseError.reason &" 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 |
With this approach, it is easy to invoke the servlet or Web service in the ASP!