Llamar servicio web desde asp

28/08/2004 - 19:18 por Layla | Informe spam
Hola a todos,

Me gustaria saber si es posible llamar a un webservice desde asp, o debo
hacerlo desde asp.net.
Y, si no fuera mucho pedir, si pudierais poner un ejemplo (me interesaria
básicamente desde asp)

grácias!
 

Leer las respuestas

#1 Franco Figún
29/08/2004 - 00:12 | Informe spam
Seria algo mas o menos asi:

<%@ Language = "VBScript" %>
<HTML>
<HEAD>
<title></title>
<%
Function GetAppSettings(key)

Dim url, xmlhttp, dom, node

'Call web service using HTTP-GET
url = "http://localhost/PWS/Ch2-3/AppServi...smx/"
url = url & "GetAppSettings?key=" & key

Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
Call xmlhttp.Open("GET", url,False)
Call xmlhttp.send

'Parse result
Set dom = Server.CreateObject("Microsoft.XMLDOM")
dom.Load(xmlhttp.responseBody)
Set node = dom.SelectSingleNode("//string")

Response.Write(Server.HTMLEncode(xmlhttp.responseText))

If Not node is Nothing Then
GetAppSettings = node.text
End If

End Function

Dim key
Dim value

If Len(Request("Submit1")) > 0 Then

Dim xmlhttp
Dim url
Dim dom

key = Request("key")
value = GetAppSettings(key)

End If
%>
</HEAD>
<body>
<P>
Application("ConnectString")= <%=Application("ConnectString") %>
</P>
<form>
<P>
<INPUT id="key" type="text" name="key" value="<%=key%>">=<%=value%>
</P>
<P>
<INPUT id="Submit1" type="submit" value="GetAppSetting" name="Submit1">
</P>
</form>
<P>
</body>
</HTML>

FF
www.francofigun.com.ar
Yahoo MSN:
ICQ: 314408886

"Layla" wrote in message
news:
Hola a todos,

Me gustaria saber si es posible llamar a un webservice desde asp, o debo
hacerlo desde asp.net.
Y, si no fuera mucho pedir, si pudierais poner un ejemplo (me interesaria
básicamente desde asp)

grácias!


Preguntas similares