ASP.NET

Team-Fly    

 
.NET and COM Interoperability Handbook, The
By Alan Gordon
Table of Contents
Chapter One.  What's in a Name ?


Continuing my overview of the .NET framework, I have finally arrived at what might be the most important technology: ASP.NET. ASP.NET is a set of technologies in the .NET Framework that make it simple to create Web applications. These technologies are divided into two main areas: Web Forms and Web services.

Web Forms

Web Forms are a set of technologies that replace ASP and make it as easy to create HTML-based Web user interfaces as it is to build VB form applications. Because of the wild popularity of VB, the forms-based user interface (UI) programming paradigm has become the accepted standard in the industry. If you are a programmer, you know what I'm talking about. Most modern development tools present you with a form and a palette of available controls. To build your UI, you drag your desired controls onto the form. You then click the controls, and you are presented with a list of properties that you can set to customize the look and feel of the controls. Many of these properties, like the colors and fonts, have their own custom editors that make it simple to change the properties. You then double-click the control to add a handler for one of the events that the control fires. This paradigm started with VB, but now almost all modern development environments, including Visual C++, support it. Web Forms bring the forms-based development paradigm to Web application development. The secret is HTML server controls. These controls function just like the standard Windows controls do in traditional application development. In fact, many are analogous to the various different controls, such as edit boxes, labels, buttons, radio buttons , listboxes, and so forth, available in the Windows API. These controls have a design-time representation that allows you to drop them onto a Web Form and use them just like regular Windows controls in VB. At runtime, these controls run on the Web server and render platform-independent HTML to the client. This book does not cover ASP.NET extensively. I've found Professional ASP.NET by Richard Anderson et al. at Wrox Press to be a pretty good book. I build some of my example programs using ASP.NET, so you will get a flavor of how it works. You can then go to another book to learn more.

Web Services

The ASP.NET Web services infrastructure provides a high-level programming model for building XML Web services on the .NET Framework. You can build XML Web services without using the ASP.NET Web services infrastructure, but the infrastructure in the .NET Framework makes XML Web service development much simpler. For instance, turning a method in a class into an XML Web service can be done with a single line of code.

The classes in the System.Web and System.Web.Services namespace contain all the logic to receive and parse a SOAP request and turn it into a method call on a Web service implementation class that you provide. The ASP.NET Web services infrastructure then takes the return values (or exceptions) from your class methods and turns them into a SOAP response. The ASP.NET Web services infrastructure even contains logic to generate a Web Services Description Language (WSDL) file automatically for any Web service simply by calling it with a "?WSDL" parameter appended to its URL.

Note

You can think of WSDL as the XML Web services equivalent of a C/C++ header .h file. If you are COM programmer, you can think of it as the XML Web services equivalent of a COM type library. A WSDL file contains the metadata for an XML Web service, that is, a description of the methods that the XML Web service exposes and the name and type of its parameters and return value. Software development tools can use a WSDL file to make it simpler to use XML Web services by automatically generating proxy classes, as the .NET Framework does.


The .NET Framework SDK contains a tool called the Web Services Description Language Tool (wsdl.exe) that you can use to build a client proxy class from this WSDL file. This proxy class handles all the low-level details to construct a SOAP request and sends it to the Web service using HTTP. To call the Web service, you only need to invoke methods on the proxy object.

The ASP.NET Web services infrastructure uses a stateless model. Each time that a service request is received, a new object is created, the request is converted into a method call on an object, and the object is destroyed . XML Web services can use the ASP.NET State Management services if they need to maintain state across requests . I cover Web services in this book starting in Chapter 10.


Team-Fly    
Top
 


. Net and COM Interoperability Handbook
The .NET and COM Interoperability Handbook (Integrated .Net)
ISBN: 013046130X
EAN: 2147483647
Year: 2002
Pages: 119
Authors: Alan Gordon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net