wcf indigo under the hood of the channel layer
Download
Skip this Video
Download Presentation
WCF (Indigo): Under the Hood of the Channel Layer

Loading in 2 Seconds...

play fullscreen
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

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

Steve Swartz

COM416

Architect

Microsoft Corporation

from the outside

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

C

C

B

B

A

A

From the Inside

Service

Bv

Bv

positioning this talk
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
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

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

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
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
Message: Constructors
  • Select Action
  • Select Message Version
  • Select Formatter
  • Body as Object, XMLReader
  • Special Support for Faults, Replies
agenda bindings

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

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
Bindings: Out of the Box

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

bindings scenarios
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
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
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
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
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

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
Factories: In Perspective
  • Apps use Channels
  • Factories Create Channels
  • Factories Share Resources
    • Per Process
    • Per Machine

Channel

Factory

Process

Manager

MachineManager

icommunicationobject
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
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
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
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

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
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
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
Channel Families: Transports

Channel

Channel

Channel

Transport

channel families encoders
Channel Families: Encoders

Channel

Channel

Channel

Channel

Encoder

channel families dual

Channel

Channel

Channel Families: Dual

Channel

DualChannel

channel families protocols
Channel Families: Protocols

ProtocolChannel

EP

EP

ProtocolChannel

TransportChannel

TransportChannel

M

M

Message

M

M

in summary
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
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

© 2005 Microsoft Corporation. All rights reserved.

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

ad