Chapter 15: Web Services

 
Chapter 15 - Web Services
bySimon Robinsonet al.
Wrox Press 2002
  

Overview

SOAP ( Simple Object Access Protocol ). In the past this issue has been fraught with difficulty, as anyone who has any DCOM (Distributed COM) experience will bear witness to. 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 may 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 us, 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 us to make use of all this. As with ASP.NET, we 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.

In addition, Web Services may be completely described using WSDL ( Web Service Description Language ), allowing dynamic discovery of Web Services at run time. WSDL provides descriptions of all methods (along with the types required to call them) using XML with XML schemas. There are a wide variety of types 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 we will:

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

  • We will discuss how to expose and consume Web Services

  • Work through a complete example building on the meeting room booker from the last chapter to illustrate their use

  • See how to exchange data using SOAP Headers

  


Professional C#. 2nd Edition
Performance Consulting: A Practical Guide for HR and Learning Professionals
ISBN: 1576754359
EAN: 2147483647
Year: 2002
Pages: 244

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