Because you want to do some interfaces of mobile dream network WAP, you need to use this method. Next, there will be an ASP.NET version. This is an ASP version. The MSXML2.XMLHTTP is used.
The following is the reference content: request.asp dim https set https = server.createObject (msxml2.xmlhttp) 'Define a XMLHTTP to the object Https.open post, http://127.0.0.1/testpost/response.asp, false Https.send <? XML Version = 1.0?> <Misc_command Version = 1.6> <Command_name> Echo </Command_name> <Command_data_block> <sid> 123456 </sign> <service_id> 987654 </service_id> <sp_id> 11111 </sp_id> <sp_password> 22222 </sp_password> </commit_data_block> </misc_command> if https.readyState = 4 then response.write submitted successfully 'ReadState reads 4 successfully, and it continues to be behind. Of course dim objstream set objstream = Server.createObject (Adodb.Stream) 'Define a stream, because it is garbled directly because it is read directly, so you have to deal with it 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 the code, just put it in HTML to close these objects objstream.close set objstream = Nothing set https = nothing end if response.write html response.asp 'Create the Domdocument object Set xml = server.createObject (msxml2.Document) xml.async = false 'Load post data XML.Load Request If xml.parseerror.errorcode <> 0 then Response.Write cannot correctly receive data & description: & xml.parseerror.reason & <br> 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 |
Using this method, it is easy to call the service or web service in ASP!