<%
' 구현부
Dim reqTy
Dim url
Dim param
url = "http://ws.cooldragon.co.kr/Service1.asmx/SayHello"
param = "name=cooldragon"
Response.Write "result=" & CallWebService(url, param) & "<br/>"
url = "http://ws.cooldragon.co.kr/Service1.asmx/Sum"
param = "x=1&y=2"
Response.Write "result=" & CallWebService(url, param) & "<br/>"
url = "http://ws.cooldragon.co.kr/Service1.asmx/Subtract"
param = "x=1&y=2"
Response.Write "result=" & CallWebService(url, param) & "<br/>"
url = "http://ws.cooldragon.co.kr/Service1.asmx/HelloWorld"
param = ""
Response.Write "result=" & CallWebService(url, param) & "<br/>"
...
'웹서비스 호출 함수
Function CallWebService(url, param)
Dim result
Dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.XMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send param
result = xmlhttp.responseText
set xmlhttp = nothing
CallWebService = result
End Function
%>