1980s - Object Oriented 1990s – Component Based (dynamic loading) 2000s – Service Oriented (doing messages.. That is when we think about distributed envirountemnt) WCF – is unified framework for building service oriented applications. Windows Communication Framework – what the HECK does that mean? WCF, WPF, WF, Microsoft’s merry-go-round of acronyms seems to have experienced exponential growth with the releases of 3.0 and 3.5. Is it all just marketing hype? Fortunately, no! WCF was first released in 3.0, and lives in its most current form in 3.5. WCF puts a wide swath of .NET service technologies all under the same roof. Windows Communication Framework utilizes declarative and configuration-driven programming to enable you to define multiple endpoints against the same code. In a lot of ways, it is very much a hybrid of legacy ASMX, WSE, Web Service Enhancements and remoting all in one. Juval Lowy very rightly describes WCF as “plumbing,” and as “an SDK for developing and deploying services on Windows.”
Replaces ASMX services. Web Services Enhancements ( WSE ) is an add-on to the Microsoft .NET Framework which includes a set of classes that implement additional WS-* Web service specifications chiefly in areas such as security, reliable messaging, and sending attachments.  Web Services are business logic components which provide functionality via the Internet using standard protocols such as HTTP. Web services communicate via either SOAP or REST messages. WSE provides extensions to the SOAP protocol and allows the definition of custom security, reliable messaging, policy, etc. All the COM+ services that are available today are available to .NET and COM objects. Some of these services include, transactions, object pooling and construction strings, JIT, synchronization, role-based security, CRM and BYOT.
TodoItem Content Priority IsDone DateTimeSent ITodoService Void SubmitTodo(TodoItem) List<TodoItem> GetTodoItems(); Void RemoveTodo(string id); [ServiceBehaviour(… InstanceContextMode] TodoService Endpoint Change first endpoint Talk on Metadata endpoint Talk on testing tool wcftestclient Time for me 
What is Endpoint. Take a look on existing configuraiton. Address, Binding, Contract Address – is where should we talk to our service – the actual network address Binding – how should we communication (transport protocol, wc…) Contract – what the service should contain… Talk more on the mex binding!!! Base address … Press F5 and talk where from metadata is downloaded and more on test client, what does it have etc.. Change base address to localhost:8080/todoservice Change the address for the first endpoint (ws) Add new endpoint basic basicHttpBinding ---- is basic SOAP interactions Contract is the same! Show how to add enpoint through the wisard TCP // evalservice New one: NamedPipes.. – is for the same machine!! Show config once again! Show the client and how it differs now I can simply choose! show from one, then from another HIGLIGHT that this is the main key feature of the WCF! you don’t need to rewrite your code once again Time 
IIS hosting - new WCF site - delete existing services - add reference - rename svc file - specify TodoServiceLibrary.TodoService and don’t need code behind it - Configure our web.config - change name of the service - reconfigure to use ITodoService - IIS version plays role - view in browser for svc file May show loading metadata from the IIS hosted application Map directory the the site’s directory! Hosting in Win Service! ServiceHost host … typeof(TodoService) host.Start(), host.Close() serviceMetadata httpGetEnabled = true Create installer, change User account to LocalSystem build project ? wsdl
Windows Communicaiton Foundation
Windows Communication Foundation Getting Started Andriy Buday http://andriybuday.com/
<ul><li>Introduction to WCF </li></ul><ul><li>What is that? Why do we need it? </li></ul><ul><li>ABC concept of the WCF </li></ul><ul><li>Hosting </li></ul><ul><li>That all are words, let better dive into code. </li></ul>Outline
Windows Communication Foundation Unified framework for rapidly building service-oriented applications
<ul><li>Data Contract </li></ul><ul><li>Service Contract </li></ul><ul><li>Simplest Ever Service </li></ul><ul><li>See how we can test it </li></ul>DEMO 1: Just to get started with something… Damn it! Let’s write some code!
Understanding WCF Principles Client Service Message Message
Client Service Message Endpoint Endpoint Endpoint
Client Service Message Address Binding Contract (Where) (How) (What) Endpoints Endpoint A B C A B C A B C
<ul><li>Endpoints in Configuration </li></ul><ul><li>ABCs in configuration </li></ul><ul><li>Different types of transferring </li></ul><ul><li>The main feature of the WCF lives here </li></ul>DEMO 2: Endpoints Damn it! Let’s configure it!
<ul><li>Claims based end-to-end security </li></ul><ul><ul><li>Secure end-to-end message exchanges </li></ul></ul><ul><ul><li>Secure access to resources </li></ul></ul><ul><ul><li>Record resource access requests </li></ul></ul><ul><li>X509, Username/Password, Kerberos, SAML, custom credentials </li></ul><ul><li>Message security </li></ul><ul><ul><li>Confidentiality and integrity </li></ul></ul><ul><ul><li>Transport or message level </li></ul></ul><ul><li>Access to resources </li></ul><ul><ul><li>Authentication and authorization </li></ul></ul>Security
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
Ways to talk <ul><li>One Way: </li></ul><ul><ul><li>Datagram-style delivery </li></ul></ul><ul><li>Request-Reply </li></ul><ul><ul><li>Immediate Reply on same logical thread </li></ul></ul><ul><li>Duplex </li></ul><ul><ul><li>Reply “later” and on backchannel (callback-style) </li></ul></ul>Client Service One Way Request-Reply Duplex (Dual)