The System.Web.Services namespace provides the necessary classes for creating custom Web services. Specifically, a Web service is derived from the WebServices class located within this namespace. In addition, a Web service class file is created with the asmx file extension.
Web service methods are exposed via the WebMethod attribute. It immediately precedes the method name. The method marked with this attribute must be declared as public, so it is available to all as a Web service method should be.
You may use the .NET language of your choice, including C#, VB.NET, J#, or so forth. I will utilise both C# and VB.NET in this example. The remaining aspects of the development follow the normal rules of development.