Web Services

SOAP IN Web services

SOAP Tutorial

adplus-dvertising
How To make a Web Services ( To Calculate Circle area using C#)
Previous Home Next
  1. Start a New Web Site
  2. Click on ASP.Net Web Services and named your service CircleArea and press on OK

  3. The code written for your application which return area of circle (Service.cs). This service contain a CircleArea method which calculate the area.
  4. using System;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    using System.Xml.Linq;
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class Service : System.Web.Services.WebService
    {
        public Service () {  }
    	[WebMethod (Description="To calculate Area of Circle")]
        public double CircleArea(int a) 
        {return 3.14 * (a * a);}
    }
    
  5. Run your service.
  6. Click on CircleArea. Service is run and when you input value the result be shown.
  7. If you want to see Service Description. Click on Service Description.
  8. Now Web service is Created.
  • If you want to know how to Use this service in Your ASP.Net Application Click Here
  • Click Here how to use in Console Application.
Previous Home Next