Creating a Web Service

So much for all the theory. How does this work in practice? The obvious thing to do next is to create a simple Web service and see how it works.

A Simple Web Service

An ASP.NET-based Web service is defined in an ASMX file. This file is similar to the ASPX files found in ASP.NET Web applications in that it can contain a mixture of ASP.NET directives (embedded in <%@ %> tags) and executable code. The main difference between an ASMX file and an ASPX file is that the ASMX file is not intended to contain any static markup. (An ASPX file will usually contain HTML as well as code.) This means that the whole ASMX file, excluding the directives, will be treated as executable code, so you do not have to enclose it in code render blocks ...

Get Microsoft® Visual J#™ .NET (Core Reference) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.