Slide 16.4: A web services example
Slide 16.6: Microsoft .NET software
Home

How to Use Web Services


Using the Web Service Example
The previous page created a web service and it can be tested as follows: These functions will send an XML response like this:
   <?xml version="1.0" encoding="utf-8" ?>
   <string xmlns="http://tempuri.org/">38</string>
Put the Web Service on Your Web Site
Using a form and the HTTP POST method, you can put the web service on your site, like this:
  • Fahrenheit Celsius:  
  • Celsius Fahrenheit:  
<form  method="post"
    action="http://www.w3schools.com/xml/tempconvert.asmx/FahrenheitToCelsius">
  Fahrenheit to Celsius:
  <input class="frmInput" type="text"   size="10" name="Fahrenheit">
  <input class="button"   type="submit" value="Submit">
</form>

<form method="post" 
    action="http://www.w3schools.com/xml/tempconvert.asmx/CelsiusToFahrenheit">
  Celsius to Fahrenheit:
  <input class="frmInput" type="text"   size="10" name="Celsius">
  <input class="button"   type="submit" value="Submit">
</form>

Substitute the value of the attribute action with the address of your web service like:
   http://www.example.com/xml/tempconvert.asmx