Chapter 12: XML Web Services and Remoting


Overview

The Microsoft .NET Framework supports two high-level distributed programming models: Remoting and XML Web services. Although these two technologies share many similarities (for example, both abstract cross-process and cross- machine calls as method invocations on a remote objects), they also have fundamental differences.

XML Web services are built using cross-platform standards and are based on the concept of XML messaging. XML Web services are executed by the ASP.NET runtime, which means that they gain ASP.NET features such as output caching. It also means that XML Web services are always stateless. Overall, XML Web services are best suited when you need to cross platform boundaries (for example, with a Java client calling an ASP.NET Web service) or trust boundaries (for example, in business-to-business transactions). The XML Web service- related recipes in this chapter discuss how to:

  • Improve the flexibility of a proxy class by not hard coding its XML Web service address (recipe 12.1)

  • Use caching to improve the performance and scalability of XML Web services (recipes 12.2 and 12.3)

  • Create a transactional XML Web service method (recipe 12.4)

  • Pass authentication credentials to an XML Web service using a proxy (recipe 12.5)

  • Call an XML Web service method asynchronously (recipes 12.6 and 12.6)

Remoting is a .NET-specific technology for distributed objects and is the successor to DCOM. It's ideal for in-house systems in which all applications are built on the .NET platform, such as the backbone of an internal order-processing system. Remoting allows for different types of communication, including leaner binary messages and more efficient TCP/IP connections, which aren't supported by XML Web services. In addition, Remoting is the only technology that supports stateful objects and bidirectional communication through callbacks. It's also the only technology that allows you to send custom .NET objects over the wire. The Remoting-related recipes in this chapter discuss how to:

  • Make objects remotable, register them, and host them on an IIS server (recipes 12.7, 12.8, and 12.9)

  • Fire events over remoting channels (recipe 12.10)

  • Control the lifetime and versioning of remotable objects (recipes 12.11 and 12.12)

  • Implement one-way methods in remotable objects (recipe 12.13)

    Note  

    This chapter points out some useful techniques with XML Web services and Remoting, but it's worth consulting a dedicated book for more detailed information. For XML Web services, you can consider Microsoft .NET XML Web Services Step by Step by Adam Freeman and Allan Jones (Microsoft Press, 2002), and for Remoting consider Advanced .NET Remoting by Ingo Rammer (Apress, 2002).




C# Programmer[ap]s Cookbook
C# Programmer[ap]s Cookbook
ISBN: 735619301
EAN: N/A
Year: 2006
Pages: 266

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