ASP.NET - What is the use of Webservice in asp.net 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-
http://www.tutorialspoint.com/webservices/
http://www.w3schools.com/webservices/ws_intro.asp
http://msdn.microsoft.com/en-us/library/ms996507.aspx

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:
http://www.google.co.in/#hl=en&sclient=psy-ab&q=introduction+to+wcf&oq=introduction+to+wcf&aq=f&aqi=&aql=&gs_l=hp.3...3760.5476.5.5648.16.13.0.0.0.9.359.2340.0j4j4j2.10.0...0.0.ajIQZayQVfg&pbx=1&bav=on.2,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
hi,

Use this link:

http://www.justskins.com/forums/what-is-the-benefits-28577.html

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

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",
   EnableSession=false)]
   public string Time() {
  return Context.Timestamp.TimeOfDay.ToString();
   }
 }


If you are creating webservice very first time have a look on this :
http://www.codeproject.com/Articles/863/Your-first-C-Web-Service