You are previewing Microsoft Windows Communication Foundation Hands-on! Beta Edition.
O'Reilly logo
Microsoft Windows Communication Foundation Hands-on! Beta Edition

Book Description

Microsoft developers, get ready for Windows Vista programming! Microsoft Windows Communication Foundation: Hands-on addresses an unmet need in the marketplace as there are no books, or much documentation at all, of the post-Beta 1 WCF programming model. This book contains the information you will need to work with this technology upon its release.

You will gain a comprehensive understanding of how to apply the Windows Communication Foundation to almost any distributed computing problem, from enterprise scale to peer-to-peer. Most importantly, after reading the book and working through the examples, you will actually have considerable experience using WCF, because the book takes you through the steps of actually building Windows Communication Foundation solutions.

Microsoft Windows Communication Foundation: Hands-on is the only book to cover capabilities comprehensively, including the facilities for building Representational State Transfer and Plain XML software services, and the extensive management interfaces.

Table of Contents

  1. Copyright
  2. Foreword
  3. We Want to Hear from You!
    1. Reader Services
  4. Introduction
  5. 1. Prerequisites—Generics and Transactions
    1. Generics
    2. System.Transactions
    3. Transaction Managers
    4. Coding System.Transactions Transactions
      1. Declarative Coding of Transactions
      2. Explicit Coding of Transactions
    5. Summary
  6. 2. The Fundamentals
    1. Background
    2. The Service Model
      1. A Software Resource
      2. Building a Service for Accessing the Resource
        1. Defining the Contract
        2. Hosting the Service
        3. Specifying an Address and a Binding
        4. Deploying the Service
      3. Using the Service
        1. Using the Service with a Windows Communication Foundation Client
        2. Different Ways of Coding Windows Communication Clients
        3. Using the Service with a Java Client
      4. Hosting the Service in IIS
      5. Securing the Service
        1. Securing the Service with a Secure Transport Protocol
        2. Encrypting Messages Before Transporting Them
      6. Debugging
    3. Summary
    4. References
  7. 3. Data Representation
    1. Background
    2. XmlSerializer and XmlFormatter
    3. The XML Fetish
    4. Using the XmlFormatter
    5. Exception Handling
    6. Summary
    7. References
  8. 4. Security
    1. Background
    2. XSI
    3. Claims-based Authorization Versus Role-based Authorization
    4. Claims-based Authorization Versus Access Control Lists
    5. Adopting Claims-based Authorization
    6. Using XSI
    7. Authorizing Access to an Intranet Resource Using Windows Identity
      1. Improving the Initial Solution
      2. Adding STSs as the Foundation for Federation
      3. Using the Windows Workflow Foundation for Claims Normalization
        1. Modifying the Authorization Mechanism of the Woodgrove Service to Use Woodgrove-Specific Claims
        2. Creating a Custom Windows Workflow Foundation Activity for Translating Fabrikam Claims into Woodgrove Claims
          1. Creating a Workflow Incorporating the Policy for Translating Fabrikam Claims into Woodgrove Claims
          2. Enhancing the Woodgrove Security Token Service to Use the Claim Mapping Workflow as Its Authorization Policy
          3. Experiencing the Power of Federated, Claims-based Identity with XSI
    8. Summary
    9. References
  9. 5. Reliable Sessions, Transactions, and Queues
    1. Reliability
      1. WS-Reliable Messaging (WS-RM)
    2. Reliability in WCF
      1. Reliable Sessions
      2. Queued Messaging
      3. When to Use Reliable Sessions and When to Use Queued Messaging
    3. Implementing Reliable Sessions
      1. Adding WCF SOAP Reliable Messaging to a WCF Project
    4. Creating a Banking Service and Client with Reliable Sessions
      1. Creating the Banking Service
      2. Creating the Client for the Service
      3. Test #1—No Sessions Enabled—Per Call Instancing
      4. Test #2—Sessions Enabled—PerSession Instancing
      5. Test #3—Sessions Enabled—Sharable Instancing
    5. Implementing Queued Messaging
      1. Queued Messaging
      2. An MSMQ Primer
        1. User-Created Queues
        2. System Queues
        3. Dead-Letter Queues and WCF
        4. Poison Messages
        5. Handling Poison Messages in WCF
      3. WCF’s Bindings for MSMQ
      4. Creating a WCF Application Using Queued Messaging
      5. Creating the Client for the Service
      6. Test #1—Client and Service Online
      7. Test #2—Service Offline When Message Sent, Online Later
    6. Transactions
      1. Atomic, Consistent, Isolated, and Durable (ACID)
        1. Atomic
        2. Consistent
        3. Isolated
        4. Durable
      2. Transactions on Windows
      3. WS-Atomic Transaction
      4. Transaction Support in WCF
        1. TransactionFlow Attribute
        2. Specifying Transactional Behaviors
        3. Specifying the Transaction Protocol in Configuration
          1. Transaction Protocol for Preconfigured Bindings
          2. Transaction Protocol for Custom Bindings
    7. Adding Transactions to the Solution
      1. Creating the Electric Company Service
      2. Creating the Banking Service
      3. Creating the ATM Client
      4. Testing the Solution
    8. Summary
  10. 6. Legacy Integration
    1. COM+ Integration
      1. Supported Interfaces
      2. Selecting the Hosting Mode
        1. COM+-Hosted
        2. Web-Hosted
        3. Web-Hosted In-Process
    2. Using the COM+ Service Model Configuration Tool
    3. Exposing a COM+ Component as a WCF Web Service
      1. Referencing in the Client
      2. Integrating with MSMQ
      3. Creating a WCF Service That Integrates with MSMQ
      4. Creating the Request
      5. Creating the Service
      6. Creating the Client
      7. Testing
    4. Summary
  11. 7. Interoperability
    1. An Overview of Interoperability
      1. WS-I Basic Profile
      2. WS-*
      3. Custom Bindings
      4. Creating Proxy Code for Use in Client Applications
    2. Creating a WCF Client for an ASMX Service with SvcUtil.exe
    3. Creating a WCF Service and WCF/ASMX Clients
      1. Creating the WCF Service
      2. Creating a WCF Client
      3. Creating an ASMX Client
    4. Creating a WCF Client for a Lotus Notes Domino Server Web Service
    5. Two for the Road
      1. Create a WCF Client to Test Interop with Sun Microsystems
      2. Create a WCF Client to Test Interop with Oracle Application Server
    6. Summary
  12. 8. Custom Transports
    1. The Windows Communication Foundation Channel Layer
    2. Adding Support for Additional Transport Protocols
      1. See the Initial Solution Work
      2. Understand the Initial Solution
      3. The Internet Mail Protocols
      4. Building an Internet Mail Transport Binding Element
        1. Getting Started
        2. Specifying a Scheme for the Internet Mail Transport Protocols
        3. The Listener
          1. Managing the Connection to the Server
          2. Providing the Account Credentials
          3. Providing an Internet Mail Encoder
        4. The Output Channel
      5. Testing the New Internet Mail Protocol Binding Element
    3. Summary
    4. References
  13. 9. Custom Behaviors
    1. Understanding the Types of Behaviors
    2. Configuring Behaviors
      1. Configuring Behaviors with Attributes
      2. Configuring Behaviors in Code
      3. Configuring Behaviors in the Configuration File
        1. Creating a Behavior Extension
    3. Creating a Behavior to Inspect Messages on the Server
      1. Creating the Auditing Service
      2. Creating the Dispatch Service Behavior
      3. Creating the Service
    4. Creating a Behavior to Inspect Messages on the Client
      1. Creating the Proxy Channel Behavior
      2. Creating the Client
      3. Testing the Solution
    5. Summary
  14. 10. Publish/Subscribe Systems
    1. Publish/Subscribe Using Callback Contracts
    2. Publish/Subscribe Using MSMQ Pragmatic Multicasting
    3. Publish/Subscribe Using Streaming
      1. The Streamed Transfer Mode
      2. Transmitting a Custom Stream with the Streamed Transfer Mode
      3. Implementing Publish/Subscribe Using the Streamed Transfer Mode and a Custom Stream
    4. Summary
    5. References
  15. 11. Peer Communication
    1. Introducing Peer Channel
      1. Using Structured Data in Peer-to-Peer Applications
      2. Leveraging the Windows Peer-to-Peer Networking Development Platform
    2. Using Peer Channel
      1. Envisaging the Solution
      2. Designing the Messages and the Message Exchange Patterns
      3. Implementing the Communication
      4. See the Peer Channel Solution in Action
      5. Securing the Peer Channel Solution
      6. Defense in Depth
      7. Style
    3. Summary
  16. 12. Manageability
    1. Administration Facilities
      1. The Configuration System
      2. The Configuration Editor
        1. Configuring the Trade Recording Service with the Configuration Editor
        2. Configuring a Client Application with the Configuration Editor
      3. Configurable Auditing of Security Events
      4. Message Logging
      5. Traces
      6. The Trace Viewer
      7. Performance Counters
      8. WMI Provider
    2. Adding Administration Facilities
    3. Summary
    4. References
  17. 13. Representational State Transfer and Plain XML Services
    1. Representational State Transfer
    2. Really Simple Syndication
    3. Objective
    4. Designing the Solution
    5. Constructing the REST RSS Server
      1. Create the RSS Feeds
      2. Define the Contract for the REST RSS Service
      3. Implement the Contract for the REST RSS Service
      4. Host the REST RSS Service in an Application
      5. Configure the Address and the Binding of the Service
      6. See a Windows Communication Foundation Plain XML REST Service in Action
    6. Constructing the RSS Aggregator
    7. Summary
    8. References
  18. 14. InfoCard
    1. Background
    2. What Is Identity?
    3. Existing Identity Solutions (“Getting to Where We Want to Be from Where We Are Today”)
    4. The Laws of Identity
    5. The Identity Metasystem
    6. The InfoCard System
    7. InfoCards in Action
    8. InfoCard Architecture and Security
    9. Basic WCF App
    10. Adding InfoCard
    11. Federation with InfoCard
    12. InfoCard from the Browser
    13. Summary and Next Steps
    14. References