Wcf indigo under the hood of the channel layer
Download
1 / 33

WCF (Indigo): Under the Hood of the Channel Layer - PowerPoint PPT Presentation


  • 150 Views
  • Uploaded on

WCF (Indigo): Under the Hood of the Channel Layer. Steve Swartz COM416 Architect Microsoft Corporation. C. C. C. B. B. B. A. A. A. From the Outside. Client. Service. Bv. Bv. Message. Bv. Bv. Address. Binding. Contract. (Where). (How). (What). C. C. B. B. A. A.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'WCF (Indigo): Under the Hood of the Channel Layer' - lam


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Wcf indigo under the hood of the channel layer l.jpg

WCF (Indigo): Under the Hood of the Channel Layer

Steve Swartz

COM416

Architect

Microsoft Corporation


From the outside l.jpg

C

C

C

B

B

B

A

A

A

From the Outside

Client

Service

Bv

Bv

Message

Bv

Bv

Address

Binding

Contract

(Where)

(How)

(What)


From the inside l.jpg

C

C

B

B

A

A

From the Inside

Service

Bv

Bv


Positioning this talk l.jpg
Positioning This Talk

  • This Talk

    • How Does the Channel Layer Work?

    • Why Do You Care?

  • Other Talks

    • How Does the ServiceModel Work?

      • COM417: Thursday, 10:00am

    • How Do You Build XML Messaging Apps?

      • COM326: Thursday, 5:15pm

    • How Do You Build Channels?

      • COM424: Thursday, 3:45pm

    • How Do You Hook Channels Into WebHost?

      • COM413: Friday, 1:00pm


Big ideas l.jpg
Big Ideas

  • Bindings: How You Use The Channel Layer

    • Bindings Are Easy & Extensible

  • Channels: How Messages Are Exchanged

    • Channels have Shape, Capabilities, Stacks

  • Factories: How Channels Are Created


The talk in a slide l.jpg

Factory

Factory

Factory

Listener

Listener

Listener

Channel

Channel

Channel

Channel

Channel

Channel

The Talk-In-A-Slide

Binding

Binding

Factory

Listener

CreateChannel<T>()

AcceptChannel()

Channel

Channel

Send()

Receive()

Message


Agenda message l.jpg

Factory

Factory

Factory

Listener

Listener

Listener

Channel

Channel

Channel

Channel

Channel

Channel

Agenda: Message

Binding

Binding

Factory

Listener

CreateChannel<T>()

AcceptChannel()

Channel

Channel

Send()

Receive()

Message


Message the basics l.jpg
Message: The Basics

  • CLR Representation of SOAP Infoset

    • Supports SOAP 1.1 / SOAP 1.2

    • Encoding-Agnostic

    • Stream-Oriented

public abstract class Message : IDisposable

{

public abstract MessageHeaders Headers { get; }

public abstract MessageProperties Properties { get; }

public abstract MessageVersion Version { get; }

public T GetBody<T>() { }

static public Message CreateMessage(...) { }

public void WriteMessage(XmlWriter writer) { }

}


Message constructors l.jpg
Message: Constructors

  • Select Action

  • Select Message Version

  • Select Formatter

  • Body as Object, XMLReader

  • Special Support for Faults, Replies


Agenda bindings l.jpg

Factory

Factory

Factory

Listener

Listener

Listener

Channel

Channel

Channel

Channel

Channel

Channel

Agenda: Bindings

Binding

Binding

Factory

Listener

CreateChannel<T>()

AcceptChannel()

Channel

Channel

Send()

Receive()

Message


Bindings what are they l.jpg

C

C

C

B

B

B

A

A

A

Bindings: What Are They?

Client

Service

Message

Address

Binding

Contract

(Where)

(How)

(What)


Bindings out of the box l.jpg
Bindings: Out of the Box

T = Transport Security | S = WS-Security | O = One-Way Only


Bindings scenarios l.jpg
Bindings: Scenarios

  • Shipping Channels

    • Change defaults

    • Change options

    • Change set of channels used

  • Future Channels

    • Change versions, functionality

    • Preserve app code

  • Custom Channels

    • Binding benefits for any channel


Binding object model l.jpg
Binding: Object Model

public abstract class Binding : IDefaultCommunicationTimeouts

{

protected Binding() { }

public abstract string Scheme { get; set{} }

public TimeSpan OpenTimeout { get; set{} }

public TimeSpan SendTimeout { get; set{} }

public TimeSpan ReceiveTimeout { get; set{} }

public TimeSpan CloseTimeout { get; set{} }

public virtual IChannelFactory<TChannel>

BuildChannelFactory<TChannel>(BindingParameterCollection p) {}

public virtual IChannelListener<TChannel>

BuildChannelListener<TChannel>(BindingParameterCollection p) {}

}


Bindings build your own l.jpg
Bindings: Build Your Own

  • Subclass Binding

  • An (Internal) Binding Element Collection

    • Completely Defines Binding, Channel Stack

  • A Constructor

    • Loads and Initializes B.E. Collection

  • A Public API

    • Simplifies Working With B.E. Collection


Binding binding elements l.jpg
Binding: Binding Elements

public abstract class BindingElement

{

protected BindingElement() { }

public virtual IChannelFactory<TChannel>

BuildChannelFactory<TChannel>(ChannelBuildContext context) {}

public virtual IChannelListener<TChannel>

BuildChannelListener<TChannel>(ChannelBuildContext context) {}

}

public class ChannelBuildContext

{

public ChannelBuildContext() {}

public BindingElementCollection UnhandledBindingElements { get; }

public BindingParameterCollection BindingParameters { get; }

public IChannelFactory<TChan> BuildInnerChannelFactory<TChan>() {}

public IChannelListener<TChan> BuildInnerChannelListener<TChan>(){}

BindingElement RemoveNextElement(){}

}


Bindings building factories l.jpg
Bindings: Building Factories

  • Call “Build()” on First Binding Element

    • It Builds Its Factory

    • It Optionally Consumes Binding Elements

    • It Optionally Consumes Binding Parameters

    • It Calls “BuildInner()” on BuildContext

    • It Wires Inner Factory to Itself

    • It Returns


Agenda factories l.jpg

Factory

Factory

Factory

Listener

Listener

Listener

Channel

Channel

Channel

Channel

Channel

Channel

Agenda: Factories

Binding

Binding

Factory

Listener

CreateChannel<T>()

AcceptChannel()

Channel

Channel

Send()

Receive()

Message


Factories in perspective l.jpg
Factories: In Perspective

  • Apps use Channels

  • Factories Create Channels

  • Factories Share Resources

    • Per Process

    • Per Machine

Channel

Factory

Process

Manager

MachineManager


Icommunicationobject l.jpg
ICommunicationObject

  • Implemented by all channels, factories

public interface ICommunicationObject : IDisposable

{

// Created, Opening, Opened, Closing, Closed, Faulted

CommunicationState State { get; }

event EventHandler Closed;

event EventHandler Closing;

event EventHandler Faulted;

event EventHandler Opened;

event EventHandler Opening;

// Async Calls Available, Too

void Open();

void Close();

void Abort();

}


Ichannelmanager l.jpg
IChannelManager

  • Implemented by all channels, factories

public interface IChannelManager : ICommunicationObject

{

MessageVersion MessageVersion { get; }

string Scheme { get; }

ReadOnlyCollection<IChannel> GetChannels();

T GetProperty<T>() where T : class;

}


Factories the client l.jpg
Factories: The Client

  • Clients Initiate Connections

  • One contract, one binding, many addresses

  • Async methods available

public interface IChannelFactory<TChannel> : IChannelFactory

{

TChannel CreateChannel(string address);

TChannel CreateChannel(Uri address);

TChannel CreateChannel(EndpointAddress to);

}

public interface IChannelFactory : IChannelManager { }


Factories the service l.jpg
Factories: The Service

  • Services Passively Wait For Connectinons

  • One address, one binding, many contracts

  • Async methods available

public interface IChannelListener<TChannel> : IChannelListener

{

void SetUri( /* … */ );

bool WaitForChannel(TimeSpan timeout);

TChannel AcceptChannel();

TChannel AcceptChannel(TimeSpan timeout);

}

public interface IChannelListener : IChannelManager { }


Agenda channels l.jpg

Factory

Factory

Factory

Listener

Listener

Listener

Channel

Channel

Channel

Channel

Channel

Channel

Agenda: Channels

Binding

Binding

Factory

Listener

CreateChannel<T>()

AcceptChannel()

Channel

Channel

Send()

Receive()

Message


Channels three shapes l.jpg
Channels: Three Shapes

public interface IOutputChannel : IChannel {

void Send(Message message);

}

public interface IInputChannel : IChannel {

Message Receive();

}

public interface IDuplexChannel : IInputChannel, IOutputChannel { }

public interface IRequestChannel : IChannel {

Message Request(Message message);

}

public interface IReplyChannel : IChannel {

IRequestContext ReceiveRequest();

}

public interface IRequestContext : IDisposable {

Message RequestMessage { get; }

void Reply(Message message);

}


Channels sessions l.jpg
Channels: Sessions

public interface ISession

{

string Id { get; }

}

public interface ISessionChannel<SessionType> where SessionType : ISession

{

SessionType Session { get; }

}

public interface IInputSession : ISession

{

}

public interface IInputSessionChannel : IInputChannel, ISessionChannel<IInputSession>

{

}


Channel families transports l.jpg
Channel Families: Transports

Channel

Channel

Channel

Transport


Channel families encoders l.jpg
Channel Families: Encoders

Channel

Channel

Channel

Channel

Encoder


Channel families dual l.jpg

Channel

Channel

Channel Families: Dual

Channel

DualChannel


Channel families protocols l.jpg
Channel Families: Protocols

ProtocolChannel

EP

EP

ProtocolChannel

TransportChannel

TransportChannel

M

M

Message

M

M


In summary l.jpg
In Summary

  • Bindings: How You Use The Channel Layer

    • Bindings Are Easy & Also Extensible

  • Channels: How Messages Are Exchanged

    • Channels have Shape, Capabilities, Stacks

  • Factories: How Channels Are Created


Community resources l.jpg
Community Resources

  • At PDC

    • For more information, go see

      • Service Model Internals: COM417, Thursday, 10:00am

      • XML Messaging: COM326, Thursday, 5:15pm

      • Building Channels: COM424, Thursday, 3:45pm

      • WebHost Integration: COM413, Friday, 1:00pm

      • Ask The Experts table: WCF Internals

      • I’ll be at COM Track lounge: Thu 3:30-6:30pm, Fri 8:30-11am

  • After PDC

    • If you miss some of these sessions, watch the DVD!

    • MSDN dev center

    • The WCF newsgroup

    • Channel 9 tag


Slide33 l.jpg

© 2005 Microsoft Corporation. All rights reserved.

This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.