Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling webservice from asp page

30 views
Skip to first unread message

Johan Notenboom

unread,
Apr 2, 2002, 3:52:57 AM4/2/02
to
Hello,
I was wondering, is it possible to call a webservice from
a 'conventional' asp application? i.e. from an asp page?
If so, can you please give me sources where I can find
information about it?
Regards,
Johan

Pierre Greborio

unread,
Apr 2, 2002, 7:12:08 AM4/2/02
to
You can do it with XMLHttp COM server. Here a simple piece of code calling
the web service with GET method (HTTP GET binding):

<html>
<body>
<%
Set oXML = CreateObject("Msxml2.XMLHTTP")

oXML.Open "GET",
"http://localhost/StockQuote.asmx/GetLastTradePrice?symbol=MSFT", False
oXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXML.Send

Response.Write oXML.responseText

Set oXML = nothing
%>
</body>
</html>

Pierre

"Johan Notenboom" <jnote...@yahoo.fr> wrote in message
news:402401c1da23$c8e5d2e0$a4e62ecf@tkmsftngxa06...

David Qiu

unread,
Apr 5, 2002, 3:58:24 PM4/5/02
to
1. Soap ToolKit2.0 (download from http://msdn.microsoft.com/soap):

Set SoapClient = CreateObject("MSSOAP.SoapClient")
Call
SoapClient.mssoapinit("http://localhost/webservice1/service1.asmx?wsdl")
MsgBox (SoapClient.CanYouTellMe("3"))

2. ServerXMLHTTP or XMLHTTP:

Set oServerXML = CreateObject("Msxml2.ServerXMLHTTP")

oServerXML.Open "GET",
"http://localhost/WebService1/Service1.asmx/CanYouTellMe?index=10", False
oServerXML.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"

MsgBox oServerXML.responseText

Set oServerXML = nothing

David Qiu

unread,
Apr 5, 2002, 10:24:17 PM4/5/02
to
If you have the .net framework installed on the ASP machine, another option
is to generate a .net web service client proxy, mark it with
[ComVisible=true], and invoke it as a com object.

You never try it myself.


0 new messages