Webservices Arithmetic
Webservices Arithmetic
Aim
Procedure
Choose File--> New website and then select ASP.Net Empty Website.
In solution explorer window, right click on the path of web location and select Add New
Item and then select webform. Also change the name of the webform (.aspx). Then click add
button.
Choose Table - > Insert Table to add a new table. Then specify the rows as 6 and
columns as 2.
Add the required label box, text box and button in the form.
A web service is a web-based functionality accessed using the protocols of the web to be
used by the web applications.
In solution explorer window, right click on the path of web location and select Add New
Item and then select webservices Also change the name of the web service(arithmetic.aspx).
Then click add button.
Coding
Webservices coding
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
<WebMethod()> _
Public Function add(ByVal a As Integer, ByVal b As Integer) As Integer
Return a + b
End Function
Public Function subtract(ByVal a As Integer, ByVal b As Integer) As Integer
Return a - b
End Function
Public Function multiply(ByVal a As Integer, ByVal b As Integer) As Integer
Return a * b
End Function
Public Function divide(ByVal a As Integer, ByVal b As Integer) As Integer
Return a / b
End Function
End Class
Webform coding
Imports Arithmetic
End Sub
Output
Result