Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows...
-
Upload
rosalyn-gardner -
Category
Documents
-
view
214 -
download
0
Transcript of Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows...
![Page 1: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/1.jpg)
Keith ElderMicrosoft MVP
INETA Speaker
Blog: http://keithelder.net/blog/
Demystifying Windows Communication Foundation
![Page 2: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/2.jpg)
Originally from Ripley, Ms
1. Raised on a small farm2. Yes I have milked a cow, slopped
the chickens and fed the hogs3. Home of the 2nd largest flea
market in the US
![Page 3: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/3.jpg)
Modelled During the 80's
![Page 4: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/4.jpg)
![Page 5: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/5.jpg)
Quicken Loans
$500! Cash!
![Page 6: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/6.jpg)
About Quicken Loans
Originally founded in 1985 as Rock Financial by Dan Gilbert
Grew to one of the largest independent mortgage banks in the country1998 IPO1999 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 employeesLargest online retail home loan lender
![Page 7: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/7.jpg)
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.
http://deepfriedbytes.com
![Page 8: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/8.jpg)
Agenda
How We Got Here
ASMX vs WCF Throwdown
WCF ContractsService
Data
Message
Bindings
Security
Reliability
Declarative
Summary
![Page 9: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/9.jpg)
From Objects to Services
PolymorphismEncapsulationSubclassing
Message-basedSchema+ContractBinding via Policy
1980s
2000s
Interface-basedDynamic LoadingRuntime Metadata
1990s
Object-Oriented
Service-Oriented
Component-Based
![Page 10: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/10.jpg)
The Challenge Radically Simplifying Distributed Application Development
Development of connected systemsremains costly and frustrating
Different programming models for different tasksNeed for security and reliable messagingInteroperability with applications on other platformsProductive service-oriented programming model needed
![Page 11: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/11.jpg)
Windows Communication Foundation
Unified framework for
rapidly building
service-oriented applications
![Page 12: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/12.jpg)
What Does WCF Replace?
ASMX
WSE
.NET RemotingCOM+
(Enterprise Services)
MSMQ
![Page 13: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/13.jpg)
DEMO
![Page 14: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/14.jpg)
OUR CURRENT ASMX SERVICES INVESTMENT VS WCF
![Page 15: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/15.jpg)
Current ASMX Web Services
![Page 16: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/16.jpg)
What’s So Different About WCF
![Page 17: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/17.jpg)
UNDERSTANDING WCF PRINCIPLES
![Page 18: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/18.jpg)
Services and Clients
Client Service
Message
Message
![Page 19: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/19.jpg)
Endpoints
Client Service
MessageEndpoint Endpoint
Endpoint
![Page 20: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/20.jpg)
Address, Binding, Contract
Client Service
Message
Address Binding Contract
(Where) (How) (What)
Endpoint
ABC A B C
Endpoints
A B C
![Page 21: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/21.jpg)
WCF Architecture: Messaging Runtime
Transport
Encoder
Protocol(s)
Transport
Encoder
Protocol(s)
ClientDispatcher
Service Contractand
Behaviors
Binding
Address
![Page 22: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/22.jpg)
CONTRACTSThe what
![Page 23: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/23.jpg)
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
![Page 24: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/24.jpg)
Ways to Talk
One Way: Datagram-style delivery
Request-ReplyImmediate Reply on same logical thread
DuplexReply “later” and on backchannel (callback-style)
Client Service
One Way
Request-Reply
Duplex (Dual)
![Page 25: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/25.jpg)
SERVICE CONTRACTSWhat does your service do?
![Page 26: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/26.jpg)
Service Contract
using System.ServiceModel;
[ServiceContract]public interface ICalculate {
[OperationContract] double Add( double a, double b); [OperationContract] double Subtract( double a, double b);
}
![Page 27: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/27.jpg)
Service Contract: OneWay
[ServiceContract]public interface IOneWayCalculator{ [OperationContract(IsOneWay=true)] void StoreProblem (ComplexProblem p);}
![Page 28: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/28.jpg)
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);}
![Page 29: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/29.jpg)
DEMO – SERVICE CONTRACT
![Page 30: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/30.jpg)
DATA CONTRACTSWhat object data needs to flow back and forth?
![Page 31: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/31.jpg)
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; }}
![Page 32: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/32.jpg)
MESSAGE CONTRACTS
Defines the mapping between the type and a SOAP envelope
![Page 33: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/33.jpg)
Message Contract
[MessageContract]public class ComplexProblem{ [MessageHeader] public string operation; [MessageBody] public ComplexNumber n1; [MessageBody] public ComplexNumber n2; [MessageBody] public ComplexNumber solution; // Constructors…}
![Page 34: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/34.jpg)
BINDINGS
![Page 35: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/35.jpg)
Bindings & Binding Elements
Transport
IPCMSMQ
Custom
TCP HTTP
ProtocolEncoders
.NETTX
Custom
Security Reliability
Binding
HTTP TXSecurity ReliabilityText
Text
Binary
Custom
![Page 36: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/36.jpg)
Standard Bindings
Binding Interop Security Session TX Duplex
BasicHttpBinding BP 1.1 N, T N N n/a
WSHttpBinding WS M, T, X N, T, RS N, Yes n/a
WSDualHttpBinding WS M RS N, Yes Yes
WSFederationBinding Federation M N, RS N, Yes No
NetTcpBinding .NET T, M T ,RS N, Yes Yes
NetNamedPipeBinding .NET T T, N N, Yes Yes
NetPeerTcpBinding Peer T N N Yes
NetMsmqBinding .NET T, M, X N N, Yes No
MsmqIntegrationBinding MSMQ T N N, Yes n/a
N = None | T = Transport | M = Message | B = Both | RS = Reliable Sessions
![Page 37: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/37.jpg)
Bindings & Behaviors: Security
Service
CBA
CBA
Client
ABC
CBA
BeBe
Bindings Insert Claims in Messages
Behaviors Implement
Security Gates
![Page 38: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/38.jpg)
Claims based end-to-end securitySecure end-to-end message exchangesSecure access to resourcesRecord resource access requests
X509, Username/Password, Kerberos, SAML, custom credentialsMessage security
Confidentiality and integrityTransport or message level
Access to resourcesAuthentication and authorization
Feature OverviewSecurity
![Page 39: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/39.jpg)
DEMO - BINDINGS
![Page 40: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/40.jpg)
Bindings & Behaviors: Transactions
Service
CBA
CBA
Client
ABC
CBA
BeBe
Bindings Flow Transactions
Behaviors AutoEnlist and AutoComplete
![Page 41: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/41.jpg)
Service
CBA
CBA
Client
ABC
CBA
Bindings provide
Session and Guarantees
Bindings & Behaviors: Reliable Sessions
![Page 42: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/42.jpg)
End-to-end Reliable messagingIn-order guarantees
Exactly once guarantees
Transport-Independent SessionsIntegration with ASP.NET Sessions in IIS-Hosted compatibility mode
TransactionsGuaranteed atomic success or failure across services
Feature OverviewReliability and Transactions
![Page 43: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/43.jpg)
Code vs. Config
![Page 44: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/44.jpg)
Defining Endpoints
<?xml version="1.0" encoding="utf-8" ?><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.serviceModel> <services> <service serviceType="CalculatorService"> <endpoint address="Calculator" bindingSectionName="basicProfileBinding" contractType="ICalculator" /> </service> </services> </system.serviceModel></configuration>
![Page 45: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/45.jpg)
Configuring Bindings
<endpoint address="Calculator" bindingSectionName="basicProfileBinding" bindingConfiguration="Binding1" contractType="ICalculator" />
<bindings> <basicProfileBinding> <binding configurationName="Binding1" hostnameComparisonMode="StrongWildcard" transferTimeout="00:10:00" maxMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" </binding> </basicProfileBinding></bindings>
![Page 46: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/46.jpg)
Custom Bindings
<bindings> <customBinding> <binding configurationName="Binding1"> <reliableSession bufferedMessagesQuota="32" inactivityTimeout="00:10:00" maxRetryCount="8" ordered="true" /> <httpsTransport manualAddressing="false" maxMessageSize="65536" hostnameComparisonMode="StrongWildcard"/> <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Default" encoding="utf-8" /> </binding> </customBinding></bindings>
![Page 47: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/47.jpg)
DEMO – MULTIPLE BINDINGS
![Page 48: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/48.jpg)
Application
Service Model
Messaging
Hosting Environments ASP.NETASP.NET WPFWPF WinFormWinForm NT ServiceNT Service COM+COM+
TCPChannel
TCPChannel
HTTPChannel
HTTPChannel
QueueChannelQueue
Channel
SecureChannelSecure
ChannelReliableChannelReliableChannel
Instance BehaviorInstance Behavior
Throttling Behavior
Throttling Behavior
Type Integ. Behavior
Type Integ. Behavior
TransactionBehavior
TransactionBehavior
ConcurrencyBehavior
ConcurrencyBehavior
ErrorBehavior
ErrorBehavior
MetadataBehaviorMetadataBehavior
BinaryEncoderBinary
Encoder
Text/XMLEncoder
Text/XMLEncoder
……
……
……
WCF Summary
WASWAS
![Page 49: Keith Elder Microsoft MVP INETA Speaker Blog: //keithelder.net/blog/ Demystifying Windows Communication Foundation.](https://reader030.fdocuments.us/reader030/viewer/2022032803/56649e2d5503460f94b1c703/html5/thumbnails/49.jpg)
WCF Summary
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