The Web Matrix project appears to have served as a test bed in the development of ASP.NET. This freebie attracted a lot of attention since it did not require an installation of IIS. It had its own http server whenever needed. Of course, one could use it also in the presence of an installed IIS. This tutorial is about creating a web service on Web Matrix and testing the service on the built in mini web server, as well as testing a second example on the IIS 5.1 on the local machine.
Creating a Web Service with Web Matrix - Second example: the Pythagoras Theorem (Page 3 of 4 )
The web service we create will return the hypotenuse, the longest side of a right angled triangle, c shown in the figure if the values of the sides "b" and "a" are known. This comes through the equation which shows that a, b and c are related by:
c=square root( a * a + b * b).
The web service shown in the next picture will deliver the measure of the hypotenuse to the client, provided the client supplies the sides a and b.
In order to use the mathematics function sqrt, the class System.Math was included using the imports System.Math statement at the top of the page. However, this did not allow returning just sqrt (a*a + b * b). Hence a full reference was given in the return statement.