70
Deepak Singhvi Abans Technologies Windows Communication Foundation (WCF 3.5) 07 Jun 2010

WCF - An Introduction

Embed Size (px)

Citation preview

Page 1: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 1/70

Deepak SinghviAbans Technologies

WindowsCommunicationFoundation (WCF 3.5)

07 Jun 2010

Page 2: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 2/70

Agenda

Introduction

Overview Contracts

Bindings

Behaviours Summary

Page 3: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 3/70

Introduction

Page 4: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 4/70

From Objects to Services

Polymorphism

Encapsulation

Subclassing

Message-based

Schema+Contract+Policy

Broad Interop

Location Transparent

Tight Coupling

Runtime Metadata

Object-Oriented Service-OrientedComponent-Oriented

1980s 2000s1990s

Page 5: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 5/70

Four tenants of Service Orientation

SERVICE ORIENTATION

Compatibility Based On Policy

Share Schema & Contract, Not Class

Services Are Autonomous

Boundaries Are Explicit

Page 6: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 6/70

So What’s new 

“Client” 

“Service” Extensibility

Metadata

Standards Support

Unified Capabilities

Programming Model

Page 7: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 7/70

Windows Communication Foundation

PRODUCTIVITYINTEROPERABILITY SERVICE-ORIENTEDDEVELOPMENT

• Broad Support for WS-* specifications

• Compatible with

existing MS distributedapplicationtechnologies

• Unifies today’sdistributed technologies

• Attribute-baseddevelopment

• Visual Studio 2005integration

• Enables developmentof loosely-coupledservices

• Config-basedcommunication

Page 8: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 8/70

WCF

The next-generation platform for distributed systems

A pillar of the Microsoft.NET Framework 3.0

Build WCF services in Visual Studio 2005 using any .NETLanguage

 – Intelligent code editing, IDE Extensions for WCF, debugging, re-factoring, code snippets, etc.

Runs on

 – Microsoft Windows Vista

 – Microsoft Windows XP

 – Microsoft Windows Server 2003

Codename “Indigo” 

Page 9: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 9/70

WCF – Message based communication

“Client” 

“Service” 

Page 10: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 10/70

Overview

Page 11: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 11/70

What is WCF

Unification of Technologies – Abstraction of service code from the transport layer

Interoperability – WS-* specification support

Service-Oriented Development – Loose Coupling

Developer efficiency – Configuration file based

 – Attribute based

Page 12: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 12/70

Widows Communication Foundation

ASMX

 Attribute-

Based

Programming

EnterpriseServices

 WS-*

Protocol

Support

Message-

Oriented

Programming

System.Messaging

.NETRemoting

Interop

with other

platforms

Extensibility 

Location transparency 

WSE

Fast,Secure,Binary

Basic,Open Comm

Secure,O en Comm

Fast,

Secure,Binary,Txns

MSMQ,Queued, Txns

Page 13: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 13/70

Conventional Web Services

The old way of easily exposing components (ASMX):

.NET Component

ASMX Web Service

HTTP Client

Page 14: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 14/70

WCF Services

The new way of easily exposing components (WCF):

.NET Component

HTTP Host TCP Host ICP Host MSMQ Host

HTTP Client TCP Client ICP Client MSMQ Client

Service Contract

Page 15: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 15/70

WCF – Standard Support ( Protocol

support)

XML

Messaging    M  e   t  a   d  a

   t  aSecurity

ReliableMessagin

g

Transactions

Page 16: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 16/70

Messaging (WS-Addressing):- SOAP is the fundamental protocol for web services. WSAddressing defines some extra additions to SOAP headers, which makes SOAP free fromunderlying transport protocol. One of the good things about Message transmission isMTOM, also termed as Message Transmission Optimization Mechanism. They optimize

transmission format for SOAP messages in XML-Binary formant using XML optimizedpackaging (XOP). Because the data will sent in binary and optimized format, it will give ushuge performance gain.

Security (WS-Security, WS-Trust, and WS-Secure Conversation):- All the three WS- defineauthentication, security, data integrity andprivacy features for a service.

Reliability (WS-Reliable Messaging):- This specification ensures end-to-end communicationwhen we want SOAP messages to be traversed back and forth many times.

Transactions (WS-Coordination and WS-Atomic Transaction):- These two specifications

enable transaction with SOAP messages. Metadata (WS-Policy and WS-Metadata exchange):- WSDL is a implementation of WS-

Metadata Exchange protocol. WS-Policy defines more dynamic features of a service, whichcannot be expressed by WSDL.

Page 17: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 17/70

Client

Binding(ordered list of channel types & config)

channel typeN

channel type 2

channel type 1config

config

config

Your code

Service

Your code   M  e   t  a   d  a   t  a

objects XML

formatting

channel

channel

channel

Transport Channel (HTTP, TCP, MSMQ, Pipes, Peer)

channel

channel

channel

decodingencoding

behaviours behaviours

Overall Architecture

Page 18: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 18/70

Main Goal

Unification

 – Unify today’s distributed technology stacks 

 – Talk on-machine, cross-machine, cross-networks & Internet

Productivity

 – Codify best practices for building distributed apps

 – Maximize productivity

Integration – Interoperate with apps running on other platforms

 – Integrate with Microsoft’s existing technologies 

Page 19: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 19/70

Callers and Services

Caller Service

Page 20: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 20/70

Caller Service

Endpoints

Endpointndpoint

Endpoint

Endpoint

Page 21: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 21/70

Service

C

C

Caller

Address, Binding, Contract

A

Address

Where?

Contract

What?

Binding

How?

C

Page 22: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 22/70

 ABC’s of WCF – Address, Binding, Contract

Three levels of abstraction expressed in WSDL

Address – Location of the service

 – Uri

 – Can be dynamic

Binding – How to talk to the service

 – Programmatic or config file based

Contract – What the service does

 – Interface based

Page 23: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 23/70

Service

Service Host

Caller

Creating Endpoints

Proxy or

ChannelFactory

A C

C

C

Page 24: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 24/70

proxy.cs

Caller

app/web.config

Exposing & Configuring Endpoints

GetMetadata

WSDL

Service

C

C

C

C

C

?

Page 25: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 25/70

Address

Consists of:

 –

Protocol – Server Name

 – Port

 – Path

Logical address does not have map to aphysical file, except in IIS

Page 26: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 26/70

Contract A collection of operations that specifies what  the Endpoint communicates to the outside

world Identified by Name and Namespace Duplex Contracts

 – Server can call client – WSDualHttpBinding

Data and Service components

There are three types of contracts – Service Contracts

Describe the operations a service can perform

Map CLR types to WSDL – Data Contracts Describes a data structure Maps CLR types to XSD

 – Message Contracts Defines the structure of the message on the wire Maps CLR types to SOAP messages

Page 27: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 27/70

Bindings

Specification of how the client and server willcommunicate

Multiple endpoints possible for a service

Predefined Bindings

 – Configuration file based

Custom Bindings

Page 28: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 28/70

Predefined Bindings

BasicHttpBinding

WSHttpBinding

WSDualHttpBinding WSFederationBinding

NetTCPBinding

NetPeerTCPBinding

NetNamedPipeBinding NetMsmqBinding

MsmqIntegrationBinding

Page 29: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 29/70

Creating a Service

Create the contract

 –

Interfaces and implementations Data Contracts

Service Contracts

Host the service

Configure bindings Create a client

Page 30: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 30/70

Contracts

Page 31: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 31/70

Service Contract

[ServiceContract]

public interface ICalculator

{

[OperationContract]

int DoMath(int a, int b, string op);

}

Page 32: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 32/70

Service Contract

An Opt-In Model

[ServiceContract]

public interface ICalculator

{

[OperationContract]

int DoMath(int a, int b, string op);

// Not exposed as part of the external contract :-)

void MethodRequiredForImplementation(bool b);

}

Page 33: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 33/70

Operations Types

Message DoXmlMath(Message m);

Untyped (“Universal”) 

MathResponse DoMsgMath(MathRequest msg);

int DoParamsMath(int a, int b, string op);

Typed Message

Parameterized Operations

Page 34: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 34/70

Service Contract: Names

[ServiceContract(Namespace="http://TechEd.WCF.Intro")]

public interface IGreetings{[OperationContract( Name=“SayHello", 

Action="http://TechEd.WCF.Intro/HelloRequest",

ReplyAction="http://TechEd.WCF.Intro/HelloResponse"

string Greet(string name);

[OperationContractAttribute(Action = "*")]

void UnrecognizedMessageHandler(Message msg);

}

Page 35: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 35/70

Service Contract: Names contd

class GreetingService : IGreetings

{public string Greet(string name)

{

return “Hello, " + name; 

}

public void UnrecognizedMessageHandler(Message msg){

Console.WriteLine("Unrecognized message: " +msg.ToString());

}}

Page 36: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 36/70

Modeling Request/Reply

Operations

On the wire everything is asynchronous

Therefore, Request and Reply correlation can be modeled in 2 ways

It can be modeled either as a synchronous (blocking) method call

or using the .NET Async-Pattern

The implementation on the client and the service can be different!

[OperationContract]

MathResponse DoMsgMath(MathRequest msg);

[OperationContract(AsyncPattern=true)]

IAsyncResult BeginDoMsgMath(MathRequest msg,

AsyncCallback cb, object state);

MathResponse EndDoMsgMath(IAsyncResult call);

Page 37: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 37/70

Service Contract: OneWay

[ServiceContract]

public interface IOneWayCalculator{

[OperationContract(IsOneWay=true)]

void DoMath(MathRequest request);

}

Page 38: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 38/70

Service Contract: Duplex

[ServiceContract(SessionMode=SessionMode.Required,

CallbackContract=typeof(ICalculatorResults)]public interface ICalculatorProblems

{

[OperationContract(IsOneWay=true)]

void DoMath(MathRequest request);

}

public interface ICalculatorResults

{

[OperationContract(IsOneWay=true)]

void DisplayResults(MathResponse response);}

Page 39: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 39/70

Service Contract: Faults

try{return n1 / n2;}

catch (DivideByZeroException e) {

MyMathFault f = new MyMathFault (n1, n2);

FaultReason r = new FaultReason("Divide By Zero");

throw new FaultException<MyMathFault>(f, r);}

[ServiceContract(Session=true)]

public interface ICalculator{

[OperationContract][FaultContract(typeof(MyMathFault))]

int DoMath(int a, int b, string op);}

Page 40: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 40/70

Data Contract

[DataContract]

public enum Position

{[EnumMember]

Employee,

[EnumMember]

Manager,[EnumMember(Value = “Vendor")]

Contractor,

NotASerializableEnumeration

}

Page 41: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 41/70

Data Contract: Names

[DataContract(Name=“Complex”, Namespace=“http://BigMath.Samples”)]

public class ComplexNumber{

[DataMember(Name=“RealPart”)]public double Real = 0.0D;[DataMember(Name=“ImaginaryPart”)]public double Imaginary = 0.0D;

public ComplexNumber(double r, double i){

this.Real = r;this.Imaginary = i;

}

}

Page 42: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 42/70

Data Contract: Enumerations

[DataContract]

public enum Position

{[EnumMember]

Employee,

[EnumMember]

Manager,[EnumMember(Value = “Vendor")] 

Contractor,

NotASerializableEnumeration

}

Page 43: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 43/70

Message Contract

[MessageContract]

public class ComplexProblem

{[MessageHeader(Name="Op", MustUnderstand=true)]public string operation;

[MessageBodyMember]public ComplexNumber n1;

[MessageBodyMember]public ComplexNumber n2;

[MessageBodyMember]public ComplexNumber solution;

// Constructors… 

}

Page 44: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 44/70

Bindings

Page 45: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 45/70

Bindings & Binding Elements

Transport

IPCSMQ

Custom

TCP HTTP

ProtocolEncoders

.NETX

Custom

Security Reliability

Binding

HTTP TXecurity Reliabilityext

Text

Binary

Custom

TCP

Binary

Page 46: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 46/70

Binding Element Features

Transport selection – TCP, HTTP, Named Pipes, P2P, MSMQ, Custom – Transport level security, Streaming

Encoding – Text, Binary, MTOM, Custom

End-to-end Security – Confidentiality, integrity, authN, authZ, Federation – Credentials: X509, User/Pwd, Kerberos, SAML, InfoCard , Custom

End-to-end Reliable messaging – Transport independent QoS (in order, exactly once) – Volatile and durable queues

Transactions – Shared transactions for “synchronous” operations  – Transactional queues for “asynchronous” operations 

[Your own feature goes here]

Page 47: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 47/70

System-Provided BindingsBinding 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 48: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 48/70

Binding in Config

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.serviceModel>

<services>

<service serviceType="CalculatorService">

<endpoint address="Calculator"

bindingSectionName="basicProfileBinding"

contractType="ICalculator" /></service>

</services>

</system.serviceModel>

</configuration>

Page 49: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 49/70

Configuring Bindings

<endpoint address="Calculator"bindingSectionName="basicHttpBinding"bindingConfiguration="UsernameBinding"

contractType="ICalculator" />

<bindings><basicHttpBinding>

<binding name="UsernameBinding"

messageEncoding="Mtom">

<security mode="Message">

<message clientCredentialType="UserName"/>

</security>

</binding>

</basicHttpBinding>

</bindings>

Page 50: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 50/70

Custom Bindings

<bindings>

<customBinding>

<customBinding>

<binding name="ReliableTCP">

<reliableSession inactivityTimeout="0:0:5“ 

ordered="true"/>

<binaryMessageEncoding/>

<tcpTransport transferMode="Buffered"/>

</binding>

</customBinding>

</customBinding>

</bindings>

Page 51: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 51/70

Choosing Bindings

WCF WCF Any Protocol Any 

Binding

 Any 

Binding

MSMQ WCF

COM+/ES WCF

MSMQ Protocol

 WS-* Protocols

MSMQ 

Binding

Moniker

ASMX/WSE3 WCF WS-* ProtocolsHttp/WS

Binding

Other Platform WCF WS-* ProtocolsHttp/WS

Binding

Page 52: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 52/70

Interaction of Bindings and Code

Bindings provide features that affect code

 – Session

 – Duplex

 – Ordered Delivery

 – Transaction Flow

 – Queued Delivery  Attribute capture the code’s requirements 

Infrastructure ensures that all the bindingssatisfy these requirements

Page 53: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 53/70

WCF Instance Creation Following are different ways by which you would like to create

WCF instances:- – You would like to create new WCF service instance on every WCF

client method call. – Only one WCF service instance should be created for every WCF

client session. – Only one global WCF service instance should be created for all

WCF clients.

To meet the above scenarios WCF has provided 3 ways by

which you can control WCF service instances:- – Per Call – Per session – Single instance

Page 54: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 54/70

 

Page 55: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 55/70

Per Call instance mode[ServiceBehavior

(InstanceContextMode =InstanceContextMode.Percall

]

public class Service : IService{

private int intCounter;

public int Increment(){

intCounter++return intCounter;

}}

Page 56: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 56/70

Per session Instance mode

[ServiceBehavior

(InstanceContextMode =InstanceContextMode.PerSes

sion)]public class Service : IService

{

private int intCounter;

public int Increment()

{

intCounter++

return intCounter;

}

}

Page 57: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 57/70

Single Instance mode

[ServiceBehavior

(InstanceContextMode =InstanceContextMode. Single

)]public class Service : IService

{

private int intCounter;

public int Increment()

{

intCounter++

return intCounter;

}

}

Page 58: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 58/70

When should you use per call, per session andsingle mode?

Per call – You want a stateless services – Your service hold intensive resources like connection object and huge

memory objects. – Scalability is a prime requirement. You would like to have scale

out architecture . – Your WCF functions are called in a single threaded model.

Per session – You want to maintain states between WCF calls. – You want ok with a Scale up architecture.

 – Light resource references Single

 – You want share global data through your WCF service. – Scalability is not a concern.

Page 59: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 59/70

 

Page 60: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 60/70

Behaviours

Page 61: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 61/70

Behaviors

Client-SideBehaviors

Service-SideBehaviors

Service

C

C

Caller

A

C

BeBe

Page 62: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 62/70

Behaviors: Overview

Behaviors are all local

Developers care about some behaviors

 – Concurrency, instancing model, … 

 – Everything that affects the correctness of the service

Deployers care about other behaviors

 – Throttling, Metadata exposure, message routing info,

…  – Everything that has to do with the service’s runtime

aspects

Anything you can do in config, you can do in code

 – Code is King – you can always override the config

Page 63: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 63/70

Example: Security

Service

C

C

Client

A

C

BeBe

Bindings MoveClaims in

Messages

BehaviorsImplement

Security Gates

Behaviors ProvideCredentials

Page 64: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 64/70

Example: Transactions

Service

C

C

Caller

A

C

Be

Bindings FlowTransactions

BehaviorsAutoEnlist andAutoComplete

Page 65: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 65/70

Anti-Example:

Reliable Sessions

Service

C

C

Caller

A

C

Bindings provideSession andGuarantees

Page 66: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 66/70

Behavior Features

Operation timeouts (close, open, idle)

Concurrency, Instancing, Thread-Binding

Throttling

Faults, Exceptions

Impersonation, Authorization, Auditing

AutoEnlist, AutoComplete, Timeout, Isolation Serialization, MustUnderstand

Metadata

More… 

Page 67: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 67/70

WCF Summary

Address Binding BehaviorContractHTTP

Transport

TCP

Transport

NamedPipeTransport

MSMQTransport

CustomTransport

WS-SecurityProtocol

WS-RMProtocol

WS-ATProtocol

DuplexChannel

CustomProtocol

http://...

net.tcp://...

net.pipe://...

net.msmq://...

xxx://...

Throttling

Behavior

MetadataBehavior

ErrorBehavior

CustomBehavior

InstancingBehavior

ConcurrencyBehavior

TransactionBehavior

SecurityBehavior

Request/Response

One-Way

Duplex

net.p2p://...

Peer

Transport

Externally visible, per-endpoint Opaque, per-service, endpoint, or op

Page 68: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 68/70

WCF Application “Architecture” 

Channels

Transport Channels 

(IPC, HTTP, TCP…) Reliability

Message

EncoderSecurity

Hosting Environments

Instance

Manager

Context

Manager

Type

Integration

Service

Methods

Declarative

Behaviors

Transacted

Methods

WASIIS .exe

Windows

Service DllHost

Messaging Services

Queuing Routing Eventing Discovery

Service Model

Application

Page 69: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 69/70

Presentation Takeaways

WCF is the future of distributed computing

It combines the best of all existing Microsoft distributed computingstacks

It uses WS-* standards for interoperability and .NET value-add forperformance and integration with existing solutions

WCF is available for Windows Vista, Windows XP SP2, WindowsServer 2003

Page 70: WCF - An Introduction

8/3/2019 WCF - An Introduction

http://slidepdf.com/reader/full/wcf-an-introduction 70/70

Thank You

[email protected] 

[email protected]