Download presentation
Presentation is loading. Please wait.
1
The Microsoft Technical Roadshow 2006 Windows Communication Foundation Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com http://mtaulty.com
2
Windows Communication Foundation Distributed Applications Themes Service Orientation Unifying Programming Models Declarative Development
3
Distributed Applications ‘Client’ Message Services pass messages described by a contract Service may provide metadata Describing the contract Describing the policy it applies to communication ‘Service’ Metadata Message (SOAP) Headers: Addressing, Security, etc Body: Payload
4
Unifying Programming Models ASMX Interoperable WSE Interoperable Secure Remoting Fast Secure ‘Objects’ COM+ Fast Secure Transactions MSMQ Queued Secure Transactions
5
Scenario – Communication Foundation IIS Upload Service Access Service Windows Service Admin Service Submit Service Viewer HTTP Submitter HTTPS Authentication Authorisation Reliable Messaging Sessions MSMQ Publisher Approver HTTPS Authentication Authorisation
6
What do I send? Where do I send it? How should I send it? Contract Address Binding Mechanics of Communication ‘Service’ ‘Client’ Transport? Encoding? Security?
7
Mechanics of Communication ‘Service’ ‘Client’ Endpoint Contract Binding Address Endpoint Contract Binding Address Endpoint Contract Binding Address
8
Contracts [ServiceContract] public interface INuggetAccess { [OperationContract] string[] GetTopics(); }.NET Interface … … WSDL svcutil.exe 'Service''Client' [ServiceContract] public interface INuggetAccess { [OperationContract] string[] GetTopics(); } public class NuggetAccessService : INuggetAccess { string[] GetTopics() { } } Implements Consumes request metadata (WSDL)
9
[ServiceContract] public interface INuggetAccess { [OperationContract] List GetTopics(); } Service Contract Details Message exchange might be One-way, request/response, two-way (Duplex) WCF also supports serialisation models from.NET 2.0 System.Xml.XmlSerialization, System.Runtime.Serialization [DataContract(Namespace=…)] public class TopicInfo { [DataMember] public int Id } Data [MessageContract] public class TypedMessage { [MessageBody] [MessageHeader] } Message
10
Defining a Contract Demo
11
Hosting Services public class Service : INuggetAccess { string[] GetTopics() { } } IIS NuggetAccessService.svc MyApp.exe ServiceHost host = new ServiceHost(); host.Open(); References ServiceHost is the key class for hosting Needs manual steps in your host application Automatically done by IIS when provided with a.svc file IIS handles additional transports in V7.0
12
Hosting a Service Demo
13
Bindings 'Service' 'Client' Message Transactions Reliability Security Transactions Reliability Security Channels Configuration Transport Channel (HTTP, TCP, etc) Configuration
14
Bindings Binding Transactions Reliability Security Channels Configuration Transport Channel (HTTP, TCP, etc) Configuration Creates a configured set of channels Standard bindings in the framework Build your own custom bindings out of new/existing channels
15
Standard Framework Bindings Pre-built set in the framework WS-I Basic Profile WS-* on HTTP TCP Named Pipes MSMQPeer Configure/code your own as a ‘custom’ binding Binding Transactions Reliability Security Channels Configuration Transport Configuration
16
Configuring a Binding Demo
17
Securing Message Exchanges Transfer Security AuthenticationPrivacyIntegrity Secure the transport or secure the message Authorisation PrincipalPermission attribute More flexible OperationRequirement Complete custom claims processing via XSI Auditing Client Message Service
18
Securing Message Exchanges Scenario
19
Reliable Messaging (!= Queues) Client and Service running at the same time Can do exactly once, in order Can control the amount of ‘buffering’ Using WS-ReliableMessaging Client Service Message 1 Intermediary Ack: Msg1 Message 2
20
Instancing, Concurrency, Sessions Service classes can be instantiated Singleton, per-call, per-session, shareable Service code can be either Single-threaded, re-entrant or multi-threaded Client Service Singleton Message B Message C Message A
21
Instancing, Concurrency, Sessions Service classes can be instantiated Singleton, per-call, per-session, shareable Service code can be either Single-threaded, re-entrant or multi-threaded Client Service Single Call Message B Message C Message A
22
Instancing, Concurrency, Sessions Service classes can be instantiated Singleton, per-call, per-session, shareable Service code can be either Single-threaded, re-entrant or multi-threaded Client Service Per Session Message B Message A session Per Session Message C
23
Reliable Messaging & Sessions Scenario
24
Transactional Messaging Client Service Message WS-AT, OleTx Distributed Transaction Coordinator
25
Queued Messaging (== Queues) Client and Service can have different lifetimes Relies on the MSMQ transport Transactional, secure, in-order, etc Client Service Message Queue Message
26
Queued Messaging Scenario
27
WCF Resources WCF http://www.windowscommunication.net WinFX http://msdn.microsoft.com/winfx http://www.roadtowinfx.com
28
© 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.