Richiamo un web service via get senza parametri
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pagina senza titolo</title>
</head>
<body>
<%
dim objXMLHTTP, strURL
strURL = "http://www.gama-system.com/webservices/servertime.asmx/GetDateTime"
Set objXMLHTTP = Server.CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strURL, False
objXMLHTTP.send()
response.Write objXMLHTTP.responseText
set objXMLHTTP = nothing
%>
</body>
</html>
richiamo un metodo di un webservice via post passando un parametro
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Pagina senza titolo</title>
</head>
<body>
<%
dim objXMLHTTP, strURL, post
strURL = "http://localhost/moneyconverter/converter.asmx/EuroToDollar"
post = "Amount=1"
Set objXMLHTTP = Server.CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "POST", strURL, False
objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXMLHTTP.send(post)
response.Write objXMLHTTP.responseText
set objXMLHTTP = nothing
%>
</body>
</html>