1. Creating a Components for Arithmetic Operations using .

NET Component Technology

Aim To Create Components for doing Arithmetic operation using .net Component Technology

Algorithm

Procedure

Click the Service.cs file and edit the code for creating web components. Each method you must start declare it has WebMethod so that it will describe as a web component
using using using using System; System.Web; System.Web.Services; System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Service : System.Web.Services.WebService { public Service () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public int add(int a, int b) { return a + b; } [WebMethod] public int sub(int a, int b) { return a - b; }

[WebMethod] public int mul(int a, int b) { return a * b; } [WebMethod] public int div(int a, int b) { return a / b; } }

After modifying the code Execute the given website project you will get this browser with service load in it.

Result

Sign up to vote on this title
UsefulNot useful