Web Service Use
Using your example ASP.NET Web Service
In the previous example we created an example Web Service.
The Fahrenheit to Celsius function can be tested here: FahrenheitToCelsius.
The Celsius to Fahrenheit function can be tested here: CelsiusToFahrenheit.
These functions will send you a XML reply.
These tests use HTTP POST and will send a XML response like this:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">38</string>
|
Use a form to access a Web Service.
Using a form and HTTP POST, you can put the web service on your site, like
this:
Use a form to access the Web Service.
Here is the code to add the Web Service to a web page:
<form target="_blank" action='http://www.example.com
/webservices/tempconvert.asmx/FahrenheitToCelsius'
method="POST">
<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 target="_blank" action='http://www.example.com
/webservices/tempconvert.asmx/CelsiusToFahrenheit'
method="POST">
<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>
|
Substitute the www.example.com in
the code above with the name of your web site.
Learn XML with <oXygen/> XML Editor - Free Trial!
 |
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|