Shani Raba Team Leader & Software Architect
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
Still need to solve Technology & Platform Transactions Communication (Protocols & patterns) Versioning
We will talk in a minute
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
What is a Service (or web service)? Some functionality exposed via a structured messaging scheme
Focus: messages sent and received Moves from a Client/Server model to a Sender/Receiver model Rich communication patterns and functionality Big Win – versioning independence
One-way (datagram) Message send, no response Request / Reply from the same receiver Message send with one reply Sender Receiver Sender Receiver Duplex Sender and Receiver can exchange multiple messages Sender Receiver
Sender Receiver Intermediary Invisible to the sender, promises to not materially change the message A received message triggers a send to another service Request / Reply from another Receiver Message sent, one or more replies from a receiver other than the original recipient Sender ReceiverIntermediary Sender Receiver
Peer To Peer (P2P) A mesh of partially connected nodes Can scale to infinite size Cool to think about, traditionally hard to do ABC D E
One-stop-shop for services Consistent object model Great features 1 st released with.NET Framework 3.0 Vista, WinSrvr 2003, Win XP SP2 Focus on the functionality, WCF takes care of the plumbing
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
.NET Fx 3.0 / 3.5 Runtime Components Windows Software Development Kit Includes C++ compilers, FxCop, Debugging Tools for Windows and WCF, and Documentation VS 2005 or VS 2008 VS 2008 has more advanced tooling support
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
Sender Endpoint Sender and the Receiver expose Endpoint(s) Receiver Meta Endpoint CB A C BA Endpoint CB A WCF ’ s ABC – Address(Where) Binding(How) & Contract(What)
The unit of communication The ABC of WCF Address – where to expose Binding – how to expose Contract – what to expose Defined in code or in configuration Service CBA CBA A BC CBA
Receiver: Uri Scheme important (net.tcp, http, net.msmq, etc.) Sender: EndpointAddress URI + WS-Addressing info
Transport, protocol, and encoding options Transports: TCP, NamedPipes, HTTP, Peer- To-Peer, and MSMQ Protocols: WS-ReliableMessaging, WS- AtomicTransaction, WS-Security, etc Encodings (format): Binary, MTOM, and Text Even more… Customizations are easy
Binding Name Transport Encoding Interop Security Session Transaction Duplex Streaming BasicHttpBindingHTTP/SText.MTOMBP 1.1 TX WsHttpBindingHTTP/SText.MTOMWST | SXXX WsDualHttpBindingHTTP/SText.MTOMWST | SXXXX NetTcpBindingTCPBinary.NETT | SXXXX NetNamedPipesBindingIPCBinary.NETT | SXXXX NetMsmqBindingMSMQBinary.NETT | SX NetPeerTcpBindingP2PBinary.NETT | SX MsmqIntegrationBindingMSMQBinaryMSMQ TX
Define the shape of the service & messages DataContracts Message ServiceContracts Operations [ServiceContract] internal interface ISomeContract { [OperationContract(Name=“Op1”)] Message Op1(Message msg); [OperationContract(Name=“Op2”)] Int32 Op2(Widget widget); } [DataContract] internal sealed class Widget { [DataMember(Order=1)] private String Name; [DataMember(Order=2)] private String Description; [DataMember(Order=3)] private Int32 Identifier; }
Define the shape of the service & messages DataContracts Message ServiceContracts Operations Service Contract Operations Behaviors communication shapes method signature Data Contract Parameters of data Scheme Versioning Strategy
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
Any process that can load an AppDomain can host an endpoint Each has ramifications (startup, monitoring, etc.) System.ServiceModel.ServiceHost central in hosting endpoints NOTE: Hosting model is completely disconnected from the ASP.NET pipeline (unlike ASMX and WSE)
Each app domain can have zero or more service host instances each service host instance is dedicated to a particular service type
Addresses, Bindings, and contracts can be setup imperatively or in a configuration file web.config or.exe.config Which one: config or imperative Tough question, depends on preference and requirements
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
Brief History Definitions Quick-start WCF Basics (ABC) WCF Basics (Hosting) WCF Tools Let’s Code… More on Architecture
Bindings Bindings configure the Channel Layer Easy to use, pluggable, extensible, big part of the universal OM Channels Channels do the actual work of messaging Channel layer tasks include WS-* choreographies, MEPs, encodings, and security Contracts Contracts define services and message schemas Contracts simplify the development experience Behaviors Behaviors impact local processing
Managing the instance Involving Transactions in code How does WCF work? How do I extend WCF? How do I control the threading model? …
Receiver Channels Sender Proxy Sender App Dispatcher Receiver App Channel Layer ServiceModel Layer Channels
Summary What is a service? What the hell is ABC? Which Hosts we have? What is fault? Name Binding Types
Related Resources (You are not alone out there) WCF Sites IDesign x=3 Microsoft.net Frameworks Bloggers Israeli Bloggers
Related Resources (You are not alone out there) On my Book Shelf Programming WCF Services Microsoft® Windows® Communication Foundation Hands-on! Inside Microsoft Windows Communication Foundation Programming “Indigo”
Shani’s contact information Blog: Thank you Nati’s contact information Blog: