How Web Services
uses
Use our ASP.NET web service example
In the previous section, we created an example
of a Web service.
Test the Fahrenheit conversion degree Celsius function here:
Fahrenheit converts to Celsius
Test the Degrees Celsius conversion fahrenheit function here: Celsius
to Fahrenheit
Using HTTP POST, this test sends an XML response like this:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">38</string>
Use forms to access web services
By using forms and HTTP POST, you can place web services on your site, such as this: Fahrenheit to Celsius:
You can place web service on your site
You can use this code to place web services on your site:
<form action='tempconvert.asmx/FahrenheitToCelsius'
method="post" target="_blank">
<table>
<tr>
<td>Fahrenheit to Celsius:</td>
<td>
<input class="frmInput" type="text" size="30" name="Fahrenheit">
</td>
</tr>
<tr>
<td></td>
<td align="right">
<input type="submit" value="Submit" class="button">
</td>
</tr>
</table>
</form>
<form action='tempconvert.asmx/CelsiusToFahrenheit'
method="post" target="_blank">
<table>
<tr>
<td>Celsius to Fahrenheit:</td>
<td>
<input class="frmInput" type="text" size="30" name="Celsius">
</td>
</tr>
<tr>
<td></td>
<td align="right">
<input type="submit" value="Submit" class="button">
</td>
</tr>
</table>
</form>
The address of "tempconvert.asmx" on the server is similar to the following:
http://www.example.com/webservices/tempconvert.asmx