Windows Communication Foundation

(formerly known as Indigo, some people also called it "ServiceModel" because service comes under syste.ServiceModel)

What is WCF?
•Simply put, a better way for building distributed systems – it’s about messages – not platforms or runtimes
•Simplifies development of connected applications through a new service-oriented programming model
•Unification of Microsoft Distributed Computing Technologies
•Interoperability with Applications Built on Other Technologies

Why Need WCF
•WCF provides the next generation of distributed communication on the basis of service oriented programming model.
• Current distributed system
–ASP.NET Web Services (ASMX) :Enables cross platform interoperability
–The Microsoft Message Queue (MSMQ) : Enables transaction integration across multiple parties
–.NET Remoting: communication with object across application domain boundaries

•WCF is all about providing a single programming model that unifies the features of ASMX, MSMQ, Remoting etc..
•WCF supports all of the scenarios currently supported by these technologies
•WCF provides developers the ability to write code once and repurpose their code as needed

WCF Basics

•Services
–A unit of functionality
–Services can be local or remote
–WCF services communicate over a variety of transports (i.e. HTTP, TCP)
–Clients and services interact by sending and receiving messages


The ABC of WCF
•Address – Address is where your service can be found. Usually in the format of scheme://domaon[:port]/path.
Example http://localhost:8080/MyService
•Binding – The binding for a service describes how a client can connect to the service
•Contract – The contract is a standard way of describing what the service does
Endpoints
–Endpoint is the fusion of the address, contract, and binding
–It is a service's interface
–Every service must expose at least one business endpoint
–Each endpoint has exactly one contract
Endpoint Addresses
•All endpoints on a service have unique addresses
•Endpoints can use the same or different bindings
•Used to locate and identify the endpoint
•Address provides location of the service and the transport protocol
http://localhost:8001 http://localhost:8001/MyService net.tcp://localhost:8002/MyService
•Structure of an Address
–Scheme: http:
–Machine: localhost
–(optional) Port: 322
–Path: /ServiceModelSamples/Service/CalService
•http://localhost:8000/ServiceModelSamples/Service/CalculatorService

Multiple endpoints on the same service



WCF Fundamentals
•Messaging and Endpoints
–WCF is based on the notion of message-based communication
–Messages are sent between endpoints
–Endpoints are places where messages are sent or received (or both)
–With WCF, all messages are SOAP messages
•An endpoint describes
–where messages should be sent
–how they should be sent
•Transport Protocol
–Messages can be sent using common transports i.e. HTTP,TCP
•Message Encoding
–Text encoding
–Binary encoding
•Message Patterns
– request-reply
– one-way
– duplex communication
•Channels
–what message goes through when it goes between a client and a host
–Usually you have multiple stacked channels
•Metadata
–describing the available functionality and possible ways of communicating with the service.
–metadata is published in a predefined
i.e. using WSDL over HTTP-GET
Bindings
•Specify the transport, encoding, and protocol details required for clients and services to communicate with each other
•Extract all these "plumbing" aspects out of service code and allow the service to focus solely on the implementation of the business logic
•Canned set of choices regarding
–Transport protocol: HTTP (or HTTPS), TCP
–Message encoding: binary encoding
–Communication pattern: synchronous, asynchronous
WCF defines nine standard bindings:
Basic binding (BasicHttpBinding): expose a WCF service as a legacy ASMX web service
TCP binding (NetTcpBinding): cross-machine communication
Web Service (WS) binding (WSHttpBinding): uses HTTP or HTTPS for transport

Contracts
•In WCF, all services expose contracts
•The contract is a platform-neutral and standard way of describing what the service does
•WCF Contracts
–Service contracts: Defines the operations the client can perform on the service
–Data contracts: Which data types are passed to and from the service

WCF Architecture

Comments

Popular posts from this blog

Understanding Top line and Bottom line?

How to activate PF UAN account

Scrum Master vs Product Owner