function test(sHo, sTen)
postUrl = "http://localhost/MyService.asmx/Hello"
DataToSend="sHo=" & sHo & "&sTen=" & sTen
Dim xmlhttp
Set xmlhttp = server.Createobject("MSXML2.XMLHTTP")
xmlhttp.Open "POST",postUrl,false
xmlhttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
xmlhttp.send DataToSend
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (xmlhttp.responseXML)
if xml.parseError.errorcode <> 0 then
Response.Write("Load xml error.")
Response.End()
end if
test = xml.documentElement.childNodes(0).text
set xmlhttp = nothing
set xml = nothing
end function
(Nguồn: http://dev.meotom.net/2009/10/16/Goi-XML-Web-Service-tu-ASP-215)
Không có nhận xét nào:
Đăng nhận xét