ASP.NET - What is the use of Webservice in c#

Asked By bhanupratap singh on 16-May-12 05:04 AM
I do not know what is the use of webservice. What is the benifit of using webservices.Pls any one explain it
Jitendra Faye replied to bhanupratap singh on 16-May-12 05:05 AM
What are Web Services?
Web services are application components
Web services communicate using open protocols
Web services are self-contained and self-describing
Web services can be discovered using UDDI
Web services can be used by other applications
XML is the basis for Web services


How Does it Work?
The basic Web services platform is XML + HTTP.

XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.

The HTTP protocol is the most used Internet protocol.

Web services platform elements:

SOAP (Simple Object Access Protocol)
UDDI (Universal Description, Discovery and Integration)
WSDL (Web Services Description Language)
Follow these links-

hope this will help you
Venkat K replied to bhanupratap singh on 16-May-12 05:16 AM
Web Service is a general model for building applications that can be implemented for any operating system that supports communication over the web.
So many clients can use / consume those web service based on their need.

But i recommend you to learn WCF [windows communication foundation] which is the next generation to web services.

More results here:,or.r_gc.r_pw.r_qf.,cf.osb&fp=ed4575b700e57eb8&biw=1280&bih=843
Somesh Yadav replied to bhanupratap singh on 16-May-12 05:32 AM
>What is the advantages of using web services?
Besides the more obvious advantage of packaging functionality for use across processes, even across radically different environments such as being consumed by non-windows processes, their is the advantage of ease of testing. This is the reuse advantage.

If you write a class library project to encapsulate the web references and only use that project to consume the web service, then as unit test and production code are using the same class project, you can test the web service thoroughly using standard NUnit or VS 2008 Pro/Team unit testing.

Once you have one unit test written, it is very easy to work through various permutations of acceptable and unacceptable input.
kalpana aparnathi replied to bhanupratap singh on 16-May-12 07:44 AM

Use this link:

Reena Jain replied to bhanupratap singh on 16-May-12 08:51 AM

The example below creates an XML Web service, deriving from WebService, in order to use the Context property to obtain the time of the request on the server.

<%@ WebService Language="C#" Class="Util" %>
 using System;
 using System.Web.Services;
 public class Util: WebService {
   [ WebMethod(Description="Returns the time as stored on the Server",
   public string Time() {
  return Context.Timestamp.TimeOfDay.ToString();

If you are creating webservice very first time have a look on this :