Presentation is loading. Please wait.

Presentation is loading. Please wait.

Keith Elder Microsoft MVP INETA Speaker Blog: Demystifying Windows Communication Foundation.

Similar presentations


Presentation on theme: "Keith Elder Microsoft MVP INETA Speaker Blog: Demystifying Windows Communication Foundation."— Presentation transcript:

1 Keith Elder Microsoft MVP INETA Speaker Blog: http://keithelder.net/blog/http://keithelder.net/blog/ Demystifying Windows Communication Foundation

2 Originally from Ripley, Ms 1.Raised on a small farm 2.Yes I have milked a cow, slopped the chickens and fed the hogs 3.Home of the 2 nd largest flea market in the US

3 Modelled During the 80's

4

5 Quicken Loans $500! Cash!

6 About Quicken Loans Originally founded in 1985 as Rock Financial by Dan Gilbert Grew to one of the largest independent mortgage banks in the country 1998 IPO 1999 Launched Rockloans.Com 1999 Intuit, Inc (makers of TurboTax and Quicken) purchased Rock Financial. July 2002 Dan Gilbert purchased Quicken Loans back from Intuit. Retained Quicken Loans branding and marketing initiatives. 5000 employees Largest online retail home loan lender

7 Deep Fried Bytes is an audio talk show with a Southern flavor hosted by technologists and developers Keith Elder and Chris Woodruff. The show discusses a wide range of topics including application development, operating systems and technology in general. Anything is fair game if it plugs into the wall or takes a battery.Keith Elder Chris Woodruff http://deepfriedbytes.com

8 Agenda How We Got Here ASMX vs WCF Throwdown WCF Contracts Service Data Message Bindings Security Reliability Declarative Summary

9 From Objects to Services PolymorphismEncapsulationSubclassing Message-basedSchema+Contract Binding via Policy 1980s 2000s Interface-based Dynamic Loading Runtime Metadata 1990s Object-Oriented Service-Oriented Component-Based

10 The Challenge Radically Simplifying Distributed Application Development Development of connected systems remains costly and frustrating Different programming models for different tasks Need for security and reliable messaging Interoperability with applications on other platforms Productive service-oriented programming model needed

11 Windows Communication Foundation Unified framework for rapidly building service-oriented applications

12 What Does WCF Replace? ASMXWSE.NET Remoting COM+ (Enterprise Services) MSMQ

13 DEMO

14 OUR CURRENT ASMX SERVICES INVESTMENT VS WCF

15 Current ASMX Web Services

16 What’s So Different About WCF

17 UNDERSTANDING WCF PRINCIPLES

18 Services and Clients ClientService Message Message

19 Endpoints ClientService Message EndpointEndpoint Endpoint

20 Address, Binding, Contract ClientService Message AddressBindingContract (Where)(How)(What) Endpoint ABCABC Endpoints ABC

21 WCF Architecture: Messaging Runtime TransportEncoderProtocol(s)TransportEncoderProtocol(s) Client Dispatcher Service Contract and Behaviors Binding Address

22 CONTRACTS The what

23 Three Types of Contracts Service Contract Defines Operations, Behaviors and Communication Shape What does your service do Data Contract Defines Schema and Versioning Strategies What obect data is used Message Contract Allows defining application- specific headers and unwrapped body content Allows control over the SOAP structure of messages

24 Ways to Talk One Way: Datagram-style delivery Request-Reply Immediate Reply on same logical thread Duplex Reply “later” and on backchannel (callback-style) ClientService One Way Request-Reply Duplex (Dual)

25 SERVICE CONTRACTS What does your service do?

26 Service Contract using System.ServiceModel; [ServiceContract] public interface ICalculate { [OperationContract] double Add( double a, double b); [OperationContract] double Subtract( double a, double b); }

27 Service Contract: OneWay [ServiceContract] public interface IOneWayCalculator { [OperationContract(IsOneWay=true)] void StoreProblem (ComplexProblem p); }

28 Service Contract: Duplex Asymmetric [ServiceContract(Session=true, CallbackContract=typeof(ICalculatorResults)] public interface ICalculatorProblems { [OperationContract(IsOneWay=true)] void SolveProblem (ComplexProblem p); } public interface ICalculatorResults { [OperationContract(IsOneWay=true)] void Results(ComplexProblem p); }

29 Service Contract: Duplex Symmetric [ServiceContract(Session=true, CallbackContract=typeof(IChat)] public interface IChat { [OperationContract(IsOneWay=true)] void Talk(string text); }

30 DEMO – SERVICE CONTRACT

31 DATA CONTRACTS What object data needs to flow back and forth?

32 Data Contract [DataContract] public class ComplexNumber { [DataMember] public double Real = 0.0D; [DataMember] public double Imaginary = 0.0D; public ComplexNumber(double r, double i) { this.Real = r; this.Imaginary = i; } }

33 MESSAGE CONTRACTS Defines the mapping between the type and a SOAP envelope

34 Message Contract [MessageContract] public class ComplexProblem { [MessageHeader] public string operation; [MessageBody] public ComplexNumber n1; [MessageBody] public ComplexNumber n2; [MessageBody] public ComplexNumber solution; // Constructors… }

35 BINDINGS

36 Bindings & Binding Elements Transport IPCMSMQ Custom TCPHTTP Protocol Encoders.NETTX Custom SecurityReliability Binding HTTPTXSecurityReliabilityText Binary Custom

37 Standard Bindings BindingInteropSecuritySessionTXDuplex BasicHttpBindingBP 1.1N, TNNn/a WSHttpBindingWSM, T, XN, T, RSN, Yesn/a WSDualHttpBindingWSMRSN, YesYes WSFederationBindingFederationMN, RSN, YesNo NetTcpBinding.NETT, MT,RSN, YesYes NetNamedPipeBinding.NETTT, NN, YesYes NetPeerTcpBindingPeerTNNYes NetMsmqBinding.NETT, M, XNN, YesNo MsmqIntegrationBindingMSMQTNN, Yesn/a N = None | T = Transport | M = Message | B = Both | RS = Reliable Sessions

38 Bindings & Behaviors: Security Service CBA CBA Client A BC CBA Be Bindings Insert Claims in Messages Behaviors Implement Security Gates

39 Claims based end-to-end security Secure end-to-end message exchanges Secure access to resources Record resource access requests X509, Username/Password, Kerberos, SAML, custom credentials Message security Confidentiality and integrity Transport or message level Access to resources Authentication and authorization Feature Overview Security

40 DEMO - BINDINGS

41 Bindings & Behaviors: Transactions Service CBA CBA Client A BC CBA Be Bindings Flow Transactions Behaviors AutoEnlist and AutoComplete

42 Service CBA CBA Client A BC CBA Bindings provide Session and Guarantees Bindings & Behaviors: Reliable Sessions

43 End-to-end Reliable messaging In-order guarantees Exactly once guarantees Transport-Independent Sessions Integration with ASP.NET Sessions in IIS-Hosted compatibility mode Transactions Guaranteed atomic success or failure across services Feature Overview Reliability and Transactions

44 Code vs. Config

45 Defining Endpoints <endpoint address="Calculator" bindingSectionName="basicProfileBinding" contractType="ICalculator" />

46 Configuring Bindings

47 Custom Bindings

48 DEMO – MULTIPLE BINDINGS

49 Application Service Model Messaging HostingEnvironments ASP.NETASP.NETWPFWPFWinFormWinForm NT Service COM+COM+ TCPChannelTCPChannel HTTPChannelHTTPChannel QueueChannelQueueChannel Secure Channel Secure Channel ReliableChannelReliableChannel Instance Behavior Throttling Behavior Type Integ. Behavior Behavior Transaction Behavior Concurrency Behavior Error Behavior Metadata Behavior BinaryEncoderBinaryEncoder Text/XMLEncoderText/XMLEncoder …… … … …… WCF Summary WASWAS

50 WCF is the future of distributed computing It combines the best of all existing Microsoft distributed computing stacks It uses WS-* standards for interoperability and.NET value-add for performance and integration with existing solutions WCF is available for Windows Vista, Windows XP SP2, Windows Server 2003, Windows Server 2008


Download ppt "Keith Elder Microsoft MVP INETA Speaker Blog: Demystifying Windows Communication Foundation."

Similar presentations


Ads by Google