Because we need to make some interfaces for Montnets WAP, we need to use this method. Next, there will be an ASP.net version. This is the ASP version, which uses the MSXML2.XMLHTTP object.
request.asp
dim HTTPS
set Https=server.createobject("MSXML2.XMLHTTP")
'Define an XMLHTTP 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</sid><service_id>987654</service_id>
<sp_id>11111</sp_id><sp_password>22222</sp_password></command_data_block>
</misc_command>"
if Https.readystate=4 then
response.write "Submission successful"
'If the readstate reading status is 4, it is successful. Continue. If it is unsuccessful, of course there is no need to continue processing dim objstream.
set objstream = Server.CreateObject("adodb.stream")
'Define a stream, because it will be garbled when you take it out directly, so you 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
'Convert the code and put it in html to close these objects objstream.Close
set objstream = nothing
set https=nothing
end if
response.write html
response.asp
'Create 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 "Unable to receive data correctly" & "Description: " & xml.parseError.reason & "<br>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
Using this method, it is very easy to call Servlet or Web Service in ASP!