joecool2005 Posted January 26, 2009 Share Posted January 26, 2009 Hi,Do you know how to call a web-service?I need to send a ouput stream to a web service. And then the web-service will read as a input stream.Thx for your help.Joe Link to comment Share on other sites More sharing options...
vikramgavli Posted August 14, 2012 Share Posted August 14, 2012 The below code calls a webservice with simple Addition and subtraction and return values <html><head><title>Calling a webservice from classic ASP</title></head><body><%If Request.ServerVariables("REQUEST_METHOD") = "POST" ThenDim xmlhttpDim DataToSendDataToSend="val1="&Request.Form("text1")&"&val2="&Request.Form("text2")Dim postUrlIf Request.Form.Item("Operation")="Sum" ThenpostUrl = "http://www.webservicex.net/CurrencyConvertor.asmx"elsepostUrl = "http://www.webservicex.net/CurrencyConvertor.asmx"end ifSet xmlhttp = server.Createobject("MSXML2.XMLHTTP")xmlhttp.Open "POST",postUrl,falsexmlhttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"xmlhttp.send DataToSendResponse.Write DataToSend & "<br>"Response.Write(xmlhttp.responseText)ElseResponse.Write "Loading for first Time"End If%><FORM method=POST name="form1" ID="Form1">Enter the two Values to perform Operation<BR><select name="Operation">Select Operation<option value="Sum">Sum</option><option value="Subtraction">Subtraction</option></select><INPUT type="text" name="text1" ID="Text1"><INPUT type="text" name="text2" ID="Text2"><BR><BR><INPUT type="submit" value="GO" name="submit1" ID="Submit1"></form></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now