|
 Chapter 1, “Basics,” is where we cover the basics of building and consuming WCF services. We discuss and demonstrate how to implement different types of interfaces and why you may choose each. By the end of this chapter, you’ll be able to produce and consume services using WCF. Chapter 2, “Contracts,” covers the three primary types of contacts in WCF: service contracts, data contracts, and message contracts. Each of these enables you to define complex structures and interfaces in code. Data contracts map .NET types to XML,
service contracts expose service interface endpoints in WSDL that can be consumed in a cross-platform manner, and message contracts enable developers to work directly on the XML in a message, rather than working with .NET types. For each of these contracts, WCF tools generate and export standards-based WSDL to the outside world. Chapter 3, “Channels,” covers channels and channel stacks. The channel model architecture is the foundation on which the WCF communication framework is built. The channel architecture allows for the sending and receiving of messages between clients and services. Channel stacks can be built to exactly match your needs. Chapter 4, “Bindings,” describes how to configure the communication stack to use exactly the protocols you need. For instance, if you’re communicating within an enterprise and won’t be crossing firewalls, and you need the fastest performance, a binding named will give you best results. If you’re looking to communicate with every last Web client out there, then HTTP and text encoded XML is necessary, so is the way to go. A binding is synonymous with a preconfigured channel stack. Chapter 5, “Behaviors,” covers service behaviors. In WCF, behaviors are the mechanism for affecting service operation outside of the actual message processing. Everything that is done after a message is received but before it is sent to the service operation code is the domain of behaviors. In WCF, this is where concurrency and instance management is handled, as well as transactional support. This chapter also demonstrates how to build custom behaviors for additional service control. Chapter 6, “Serialization and Encoding,” describes the process by which data is serialized from a .NET Type (class) to an XML Infoset and the way that XML Infoset is represented on the wire. We typically think of XML as a text document with angle brackets around field names and values, but the XML Infoset is a more basic data structure. This chapter discusses ways of converting that structure into a format that can be exchanged over a network. Chapter 7, “Hosting,” describes the various options in hosting a WCF service. The most common environment, IIS, is described, but it is by far not the only option. WCF services can be hosted in Managed .NET applications, Windows Activation Services, or any other .NET program. This chapter discusses the options and techniques for hosting. Chapter 8, “Security,” is a large chapter and covers the multitude of security options. Different authentication schemes are discussed and demonstrated. Transport- and message-level security are compared, with examples of each. Intranet and Internet scenarios are also described. Chapter 9, “Diagnostics,” describes how to use the built-in trace facilities in .NET to capture WCF events. Trace Listeners are described, along with examples that show how to configure the settings for different events. The Trace Viewer, a powerful tool that is shipped with WCF, is also described, which enables you to trace activities across service call boundaries. Chapter 10, “Exception Handling,” offers practical guidance on handling exceptions within WCF. SOAP faults are described using fault contracts, and examples demonstrate how to throw and catch them to minimize errors. Chapter 11, “Workflow Services,” covers the integration points between WCF and Windows Workflow Foundation (WF) introduced in Visual Studio 2008 and .NET 3.5. We describe how to call WCF services from WF and how to expose WF workflows in WCF. Chapter 12, “Peer Networking,” shows how to build client-to-client applications that leverage a network mesh to enable clients to find each other. We cover mesh addressing and techniques for establishing point-topoint connections after the client addressing is resolved. Chapter 13, “Programmable Web,” covers how to use WCF for non-SOAP Web Services. Examples are shown with Asynchronous JavaScript and XML (AJAX) and JSON for simpler, JavaScript-friendly data formats. The hosting classes specific to non-SOAP protocols are described. Like WCF-WF integration, this is new with .NET 3.5. Download free ebooks on .net: Essential Windows Communication Foundation (WCF): For .NET Framework 3.5
|