ASP.NET automates the detailed work necessary to unpack a SOAP request and turn it into a real method call. ASMX files are handlers in the same way as ASPX and ASHX files. ASMX files implement IHttpHandler by parsing the incoming XML, calling a method in the code-behind class, and returning a result. Simply adorning the method with the [WebMethod] attribute inserts the necessary functionality.
Visual Studio is also useful for consuming Web services. By adding a Web reference to your application, Visual Studio will consult the Web service for the WSDL code and use it to build a proxy. From there you simply instantiate the proxy and call methods. The proxy takes care of preparing the SOAP payload and sending it. The proxies generated by Visual Studio also support asynchronous method invocation so that the main calling thread doesn't block for too long.
Tutorial 19 Quick Reference
How to create a Web service
From an ASP.NET project, select Web Site | Add New Item from the main menu
Select the Web Service template
Expose a class method as a Web method
Apply the [WebMethod] attribute immediately preceding the method signature
How to consume a Web service
From within Visual Studio, select the project in solution explorer.
Right-click on project
Select Add Web Reference
Surf to the Web service. Visual Studio will automatically ask for the WSDL and build a proxy