Uso de Web Services
- Página anterior Ejemplo de WS
- Página siguiente Resumen de WS
Usar nuestro ejemplo de ASP.NET Web Service
En la sección anterior, creamos un Ejemplo de Web Service.
Prueba aquí la función de conversión de grados Fahrenheit a Celsius:Conversión de grados Fahrenheit a Celsius
Prueba aquí la función de conversión de grados Celsius a Fahrenheit:Conversión de grados Celsius a Fahrenheit
Estas funciones le enviarán una respuesta XML
Esta prueba utiliza HTTP POST y enviará una respuesta XML similar a esta:
<?xml version="1.0" encoding="utf-8" ?> <short xmlns="http://codew3c.org/">38</short>
Usar formularios para acceder a Web Service
Al usar formularios y HTTP POST, puedes ubicar el web service en tu sitio web, por ejemplo:
Puedes colocar el web service en tu sitio
Puedes usar este código para colocar el web service en tu sitio:
<form target="_blank" action='http://codew3c.com/webservices/tempconvert.asmx/FahrenheitToCelsius' method="POST"> <label>Convertir grados Fahrenheit a Celsius:</label> <p> <span> <input class="frmInput" type="text" size="30" name="Fahrenheit"> </span> <span> <input type="submit" value="Enviar" class="button"> </span> </p> </form> <form target="_blank" action='http://codew3c.com/webservices/tempconvert.asmx/CelsiusToFahrenheit' method="POST"> <label>Convertir grados Celsius a Fahrenheit:</label> <p> <span> <input class="frmInput" type="text" size="30" name="Celsius"> </span> <span> <input type="submit" value="Enviar" class="button"> </span> </p> </form>
- Página anterior Ejemplo de WS
- Página siguiente Resumen de WS