A Web Service may be defined as an independent and self-sustained unit of a software application that may be hosted on the internet. Suppose, you could design specific functionality of a web service to execute the business logic of an application?
A Web service can do many things. It also can be used to implement various functionalities, like calculating interest, calculating pay slips and so on. You can create a Web Service in ASP.NET 4.5 and above, which is known as ASP.NET 4.5 Web Service and consists of an infrastructure that contains various components used to implement basic functionality, such as calling a Web Service, locating a Web Service and so on. You can also create Web Service that uses the ASP.NET AJAX functionality.
So, what are Web Services?
In simple words, web service is an application or software that is programmed to perform a functionality to interact over the internet or over the networks. Web services are language independent as they communicate using standard protocols, like HTTP, SOAP and XML.
NOTE - ASMX Web services are a legacy technology. Most of the companies are now using WCF (Windows Communication Foundation) to build XML Web Services and XML Web Service client. In this series, we will cover ASP.NET Web service and how to use ASP.NET Web Services.
Web services are a standardized way for developing interoperable applications; i.e., enabling an application to invoke a method of another application. These applications can be used on the same computer or different computers as well.
A web service allows the user to interact with other applications or websites irrespective of the programming language in which they are developed or created. Web service can be accessed by any application, regardless of the hardware and software platform in which it is running, because web services use protocols like SOAP (Simple Object Access Protocol) and WSDL(Web Service Description Language ). Web services use open standards and protocols, like HTTP, XML, and SOAP. Since these are well known protocols, the application built on any platform can inter-operate with web service.
Example
A JAVA application can inter-operate with a web service built using .NET. Similarly, a web service built in JAVA can be consumed by a .NET application .
A web service contains all logic which can be bundled into one application and that application can interact with multiple applications at the same time. They can be shared with multiple applications without a need to install them on an individual Server or Client machine.
Architecture of Web Service

A web service architecture consists of an application (be it Console application, Web application and so on) as ASP.NET web service application and other ASP.NET Web service files, like .asmx and .dll files. You need a web Server to monitor both your application and web services file, and a database in order to save or retrieve the data.
Now, we will see how to build a web service.
Let's flip to Visual Studio. Here, I am using VS 2015.

Click on Web and give a suitable name.

Create an "Empty" application.

Now, in that project, we will add a web service.
Right click on Solution, go to Add -> New Item.

Give your web service name as "Calculator.asmx".

When you click on "Add", the Calculator Service will get created. Now, let's examine the auto-generated code.

As you can see, the Calculator we had added is a class, but this class service is declared with web service attributes. Basically, this attribute tells that this class Calculator contains web service code.
The web service has got namespace property. Basically, these namespaces are used to uniquely identify your web service from the other web services that are already there on the web-bed.
Example
Here, we have this calculator web service. When we are done building this, we will publish this on the internet. Now, another developer develops a same service name as calculator. So basically, to uniquely identify your web service from the other web services that are already there on the web, we use this namespace property which actually is a string.













Manav PandyaPosted Dec 5, 2016, 4:26 AM
I mean login with Linkedin or facebook through ASP.NET WebService
Manav PandyaPosted Dec 5, 2016, 4:25 AM
I hav same demo created before can you upload more article for any real life use with WebService ASP.NET
Former memberPosted Dec 5, 2016, 4:01 AM
Please come with few good article for web service security with ssl and certificate