Chapter 28: Web Services


Overview

Web services are a new way of performing remote method calls over HTTP that can make use of Simple Object Access Protocol (SOAP). In the past this issue has been fraught with difficulty, as anyone who has any DCOM (Distributed COM) experience knows. The act of instantiating an object on a remote server, calling a method, and obtaining the result was far from simple, and the necessary configuration was even trickier.

SOAP simplifies matters immensely. This technology is an XML-based standard that details how method calls can be made over HTTP in a reproducible manner. A remote SOAP server is capable of understanding these calls and performing all the hard work for you, such as instantiating the required object, making the call, and returning a SOAP-formatted response to the client.

The .NET Framework makes it very easy for you to make use of all this. As with ASP.NET, you are able to use the full array of C# and .NET techniques on the server, but (perhaps more importantly) the simple consumption of Web services can be achieved from any platform with HTTP access to the server. In other words, it is conceivable that Linux code could, for example, use .NET Web Services, or even Internet-enabled fridges. To quote a real-world example, in the past I have had great success combining Web services with Macromedia Flash to create data-enabled flash content.

In addition, Web services can be completely described using Web Service Description Language (WSDL), allowing dynamic discovery of Web services at runtime. WSDL provides descriptions of all methods (along with the types required to call them) using XML with XML schemas. A wide variety of types are available to Web services, which range from simple primitive types to full DataSet objects, such that full in-memory databases can be marshaled to a client, which can result in a dramatic reduction in load on a database server.

In this chapter, you do the following:

  • Look at the syntax of SOAP and WSDL, then move on to see how they are used by Web services.

  • Learn how to expose and consume Web services.

  • Work through a complete example building on the meeting room booking application from Chapter 26, "ASP.NET Pages," and Chapter 27, "ASP.NET Development," to illustrate the use of Web services.

  • Learn how to exchange data using SOAP Headers.




Professional C# 2005
Pro Visual C++ 2005 for C# Developers
ISBN: 1590596080
EAN: 2147483647
Year: 2005
Pages: 351
Authors: Dean C. Wills

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