Today, I am going to explain, what are web service in .NET with advantages and uses.. I will also explain how web services came in picture and before web services which technology worked.
What is web service
Web Service is an application or we can say a standard way for interacting directly with other applications over the internet. It is a way to develop interoperable application over the internet.
Web Service can locate on same computer within same network or different computer with different network. Web service is protocol independent, language independent and platform independent. Web services support standard protocol and data format like HTTP, XML, and SOAP.

How web services came in picture
Before web service there were two more technologies in picture,
COM
COM is known as Component Object Model. It allows interacting two objects on the same computer or machine but application can be different. We cannot use different application located on different computer using COM. It was the limitation of COM.
DCOM
To remove limitation of COM, a new technology introduced known as DCOM. DCOM is short form of Distributed Component Object Model. Using DCOM we can access two different application or object on different computer but both applications must be on same network. This was the limitation of DCOM.
Web Service
To remove limitation of DCOM new interoperable technology came in picture known as Web service that allow us to interact with other object or application which is located on different network.
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Linq;
- using System.Web;
- using System.Web.Services;
- using System.Web.Services.Protocols;
- using System.Xml.Linq;
- namespace StockService
- {
- // <summary>
- // Summary description for Service1
- // <summary>
- [WebService(Namespace = "http://tempuri.org/")]
- [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- [ToolboxItem(false)]
- // To allow this Web Service to be called from script,
- // using ASP.NET AJAX, uncomment the following line.
- // [System.Web.Script.Services.ScriptService]
- public class Service1 : System.Web.Services.WebService
- {
- [WebMethod]
- public string HelloWorld()
- {
- return "Hello World";
- }
- }
- }
Web services use XML format message to interact with other system. Xml format is a standard way to communicate between two incompatible systems. Web service sent message over HTTP protocol. So, message reaches to any system over internet without being blocked by firewall.
What is WSDL
WSDL means Web Services Description Language. Web services description language tell to client what types of message it accept and what will be returned as an output. WSDL contain every detail of web services like what is communication protocol method name, data type used.

Reference
If you want to know more please click here.
Thanks for reading this article, hope you enjoyed it.

Hadshana KamalanathanPosted Jul 22, 2018, 1:47 AM
Useful one..
Bhargav BattinaPosted Jul 24, 2017, 6:23 AM
Great content is written by the author. it gave me many things to know about the points to be considered while choosing a web designing company for my business. thank you mukesh for such a great knowledge.
sheetal kalraPosted May 19, 2017, 3:39 AM
Great content is written by the author. it gave me many things to know about the points to be considered while choosing a web designing company for my business. thank you mukesh for such a great knowledge. <a href="http://sanchay.co/">Web Designing Company</a>
SubashPosted Sep 7, 2016, 7:24 AM
Useful one
Asfend YarPosted Mar 12, 2016, 2:53 PM
nice
Santhakumar MunuswamyPosted Dec 26, 2015, 2:19 AM
Thanks for nice article
Suman VermaPosted Dec 22, 2015, 8:19 AM
nice one
Aishwarya DPosted Dec 22, 2015, 1:51 AM
Nice one
Ankur MistryPosted Dec 21, 2015, 6:49 AM
useful stuff
Rajeesh MenothPosted Dec 20, 2015, 11:24 PM
Good One
Manoj KallaPosted Dec 20, 2015, 2:18 PM
Good one. Thank You sharing.