The Web File Share Application

Summary

This chapter demonstrates how easy it is to create and consume Web services using Visual Studio .NET. You create two Web services, one to validate a credit card and the other to send and retrieve files.

The first example demonstrates the ease with which you can factor Web services into your existing .NET applications. You are easily able to move the business logic for your Web application and place it into its own Web service. The second example, in which you create a Web service for receiving files, demonstrates the flexibility of Web services and the robustness of the .NET Framework.

Almost all of the code you write in this chapter is related to business logic instead of building infrastructure. The only code you write to expose methods as Web services is to decorate the method with the WebMethod attribute. The ASP.NET framework handled decoding the request message from the client and encoding the response message.

Microsoft .NET provides many services for the client as well. Visual Studio .NET automatically generates a proxy from the Web service's WSDL document. You can think of the WSDL document as the Web services equivalent to a COM TypeLib. It contains information about the properties, methods, and enumerations exposed by the Web service.

The Visual Studio .NET–generated proxy allows you to code against the Web service as if it were another strongly typed .NET object. One of the primary advantages of strong typing is that type mismatch errors can be caught at compile time instead of at run time. Another advantage is IntelliSense. As you code against the Visual Studio .NET–generated proxy object, IntelliSense displays the list of methods exposed by the Web service. Once a method is selected, IntelliSense displays the names and the types of each parameter within the method.

In subsequent chapters, you will learn about the protocols that Web services are built on, such as WSDL and SOAP, and about the .NET technologies such as ASP.NET that you can use to build and consume Web services.



Building XML Web Services for the Microsoft  .NET Platform
Building XML Web Services for the Microsoft .NET Platform
ISBN: 0735614067
EAN: 2147483647
Year: 2002
Pages: 94
Authors: Scott Short

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