Overview of ASP.NET Web Services

ASP.NET Web Services are built on top of ASP.NET and use industry standard data formats and transport protocols that include SOAP, XML, and WSDL. The .NET platform gives ASP.NET Web Services the capability to take advantage of the platform's architectural enhancements; for example, all ASP.NET code is compiled rather than interpreted, allowing early binding and strong typing. ASP.NET is also just-in-time (JIT) compiled to native code at execution time, dramatically improving its execution speed compared to that of traditional ASP applications. ASP.NET Web Services' adherence to industry standards, such as SOAP, XML, and WSDL, allows clients from other platforms to seamlessly interoperate with and call an ASP.NET Web Service.

ASP.NET Web Services support client communication using three protocols: SOAP, HTTP-GET, and HTTP-POST. HTTP-GET and HTTP-POST support the passing of parameters in named value pairs. SOAP passes data to and from a Web Service using XML, allowing developers to define complex data types using XSD schemas.

As mentioned earlier, the system services required to implement a Web Service can become complex if not augmented by a vendor's implementation. Although not impossible to develop, most Web Service vendors normally hide this complexity from the developer. Microsoft's ASP.NET is no different; in fact, its feature set is robust, allowing developers to focus on the implementation details as opposed to underlying system services plumbing. In fact, developing a Web Service with Visual Studio .NET is as simple as building a standard class object. The development environment generates all the code required to communicate using HTTP and SOAP automatically.

An ASP.NET Web Service has a file extension of .asmx and can be created using Visual Studio .NET or any standard text editor. The simplest way to run and/or test an .asmx Web Service is to request its URL in a Web browser. When you request the .asmx file in a browser, the Web server returns a Web Service description page allowing you to test each of the Web Service methods.

You can also call an ASP.NET Web Service programmatically, both synchronously and asynchronously from a managed .NET client. To access a Web Service programmatically from a .NET client application, you add a Web reference to the Web Service project.

When you create a Web reference, Visual Studio .NET automatically creates and adds a Web Service proxy class for each Web Service to your project. The proxy class exposes the methods of the Web Service and handles the marshalling of data between the Web Service and your client application. Visual Studio .NET uses the Web Service service description language (WSDL) file to create the proxy class. This proxy class allows you to invoke the exposed methods of the Web Service just as you would any other method of a local component. If the Web Service is not accessible at development time, you can use the WSDL command-line tool (Wsdl.exe) to generate a Web Service client proxy class from a WSDL file manually.

The next section walks you through the steps required to expose the Visual Basic .NET managed classes created in Chapter 14 in the BankVB.vb object as Web Services.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset