3/25/2017 8:53 AM Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer Kenny Wolf, Software Development Engineer.

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Virtual Trunk Protocol
Network Programming and Java Sockets
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
19 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Developing Web Services.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Indigo Jonathan Turnbull Nick Cartwright Ivan Konontsev Chris Bright.
ZMQS ZMQS
Communicating over the Network
Server Access The REST of the Story David Cleary
JD Edwards Service JD Edwards Service SAP Service SAP Service Java Appl. Service Java Appl. Service.Net Appl. Service.Net Appl. Service CICS Service.
Campus02.at don't stop thinking about tomorrow DI Anton Scheibelmasser Setubal ICINCO /25 Device integration into automation systems with.
GETTING STARTED WITH WINDOWS COMMUNICATION FOUNDATION 4.5 Ed Jones & Grey Guindon.
ABC Technology Project
IP Multicast Information management 2 Groep T Leuven – Information department 2/14 Agenda •Why IP Multicast ? •Multicast fundamentals •Intradomain.
1 Network Address Translation (NAT) Relates to Lab 7. Module about private networks and NAT.
Squares and Square Root WALK. Solve each problem REVIEW:
31242/32549 Advanced Internet Programming Advanced Java Programming
© 2012 National Heart Foundation of Australia. Slide 2.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 EN0129 PC AND NETWORK TECHNOLOGY I NETWORK LAYER AND IP Derived From CCNA Network Fundamentals.
Processes Management.
Chapter 5 Test Review Sections 5-1 through 5-4.
SIMOCODE-DP Software.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
WCF Intro Scott Reed Owner - Brain Hz Software Instructor – DevelopMentor
Addition 1’s to 20.
25 seconds left…...
Presentation 7 part 2: SOAP & WSDL.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA TCP/IP Protocol Suite and IP Addressing Halmstad University Olga Torstensson
Week 1.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.1 Module 11 TCP/IP Transport and Application Layers.
We will resume in: 25 Minutes.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.1 Module 9 TCP/IP Protocol Suite and IP Addressing.
VPN AND REMOTE ACCESS Mohammad S. Hasan 1 VPN and Remote Access.
Chapter 11 Component-Level Design
1 Windows Communication Foundation Adapters in BizTalk Server 2006 R2 Ulrich Roxburgh Services2 Ltd. SOA307.
Registry system data exchange General design requirements Pre-sessional Consultations on Registries 19 October 2002 New Delhi, India UNFCCC secretariat.
Computer Net Lab/Praktikum Datenverarbeitung 2 1 Overview Sockets Sockets in C Sockets in Delphi.
Java Network Programming Vishnuvardhan.M. Dept. of Computer Science - SSBN Java Overview Object-oriented Developed with the network in mind Built-in exception.
The Microsoft Technical Roadshow 2006 Windows Communication Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
Getting Started with Windows Communication Foundation 4.5 Ed Jones, MCT, MCPD, MCTS Consultant RBA Inc.
Future Directions for Leveraging Advanced XML Tools and Building Custom XML Solutions Denise Draper DAT321 Microsoft Corporation.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
1 Windows Communication Foundation: Integrating COM+ and MSMQ Applications Andy Milligan COM305 Program Manager Microsoft Corporation.
1 IIS and Windows Communication Foundation: Hosting Services Steve Maine COM 413 Program Manager Microsoft Corporation
Random Logic l Forum.NET l Web Services Enhancements for Microsoft.NET (WSE) Forum.NET ● October 4th, 2006.
A Deep Dive into Best Practices with the Windows Communication Foundation John Justice COM415 Program Manager Microsoft Corporation.
Developing Web Services Using ASP.NET and WSE That Interoperate with the Windows Communications Foundation ("Indigo") Mark Fussell COM432 Lead Program.
.NET Enterprise Services COM+ 1.5 麥超俊 Bobby Mak 架構技術推廣經理開發工具暨平台推廣處台灣微軟股份有限公司.
Lap Around Windows Presentation Foundation Rob Relyea PRS305 Lead Program Manager Windows Presentation Foundation
Kemal Baykal Rasim Ismayilov
Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation.
Windows Communications Foundation ("Indigo"): Writing Secure Distributed Applications Martin Gudgin COM312 Program Manager Microsoft Corporation.
OE-NIK HP Advanced Programming WCF WCF SOAP service, host, client Exception handling (NOT required)
Mike Harsh PRSL001 Program Manager Microsoft Corporation
Windows Communication Foundation (WCF)
WCF (Indigo): Under the Hood of the Channel Layer
Implementing RESTful Services Using the Microsoft .NET Framework
Windows Communication Foundation (WCF)
Presentation transcript:

3/25/2017 8:53 AM Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer Kenny Wolf, Software Development Engineer Yasser Shohoud, Lead Program Manager COM424 Microsoft Corporation ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Channel extensibility is an opportunity for component vendors What’s in it for you? Enable new transports (e.g. SMTP, UDP) Integrate with other systems (e.g. Java RMI) Implement custom infrastructure protocols Channel extensibility is an opportunity for component vendors

Endpoints and Channels ServiceHost host = new ServiceHost(typeof(MyService)); Uri address = new Uri(“net.tcp://kennyw2/Service/endpoint”); Binding binding = new NetTcpBinding(); Type contract = typeof(IMyContract); host.AddEndpoint(address, binding, contract); host.Open();

Channel Types Dispatcher Proxy Protocol Channel(s) Protocol Channel(s) Transport Channel Transport Channel

Layered Extensibility Service Model Extensibility (local only) Dispatcher Proxy Protocol Channel(s) Protocol Channel(s) Channel Extensibility (affects the wire) Transport Channel Transport Channel

Outline Writing a TCP transport Writing a chunking protocol channel 3/25/2017 8:53 AM Outline Writing a TCP transport Writing a chunking protocol channel Wrap up and Q&A This session focuses on writing custom channels Protocol channels Transport channels Channel architecture was covered in previous talks We will recap briefly ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Channel Shapes IOutputChannel IInputChannel IRequestChannel 3/25/2017 8:53 AM Channel Shapes IOutputChannel IInputChannel IRequestChannel IReplyChannel 3 types of Channel Shapes (BEANBAGS) 1. Datagram: Messages are “fire and forget”. (THROW BEANBAG OVER HEAD) This is like sending a postcard in the mail (could get lost). Or like UDP. This is a building block for Messaging since arbitrary protocols can be built on top of it. 2. Request-Response: (THROW BACK AND FORTH BETWEEN KENNY AND YASSER) Common MEP. RPC, browser GETs, etc. 3. Duplex: bi-directional communication. (KEEP THROWING IN RANDOM ORDER) This is like speaking to a co-worker, etc. * Also Session-ful variants of each of these protocols. * Factories can support multiple shapes For Request-Response you get an IRequestContext instead of a Message (this comment should go in later slides though, doesn’t matter for the overview) IDuplexChannel ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Sockets vs. Channels (Client) 3/25/2017 8:53 AM Sockets vs. Channels (Client) Channel Socket new Socket(); socket.Connect(IP, port) CreateChannel(Uri); channel.Open() socket.Send(byte[]) channel.Send(Message) Throws CommunicationException or TimeoutException Throws SocketException socket.Close() channel.Close() Highlight: Addressing differences (IP+port vs. Uri) Unit of data differences (bytes vs. Message) Message is the fundamental unit of data at the Channel Layer. Message has two parts: a body and extensible collection of headers. Access to a header or body is through XmlReader/XmlWriter, as it’s fundamentally Infoset. Channels Send and Receive Messages. Unit of Data Transferred Exception contract Addressing Shutdown Client {0x08, 0xAF, 0x6D, 0xBE, 0xEF, ...} <Envelope><Body>...</Envelope> my.tcp://kennyw2:808/myService/ (172.30.16.60, 808) Service ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Unit of Data Transfer Message  Bytes 3/25/2017 8:53 AM Unit of Data Transfer Message  Bytes MessageEncoder Text, Binary, and MTOM ship with “Indigo” BufferManager Proper tuning can yield large (>10%) performance increases ArraySegment<byte> WriteMessage(Message, maxSize, BufferManager) Message ReadMessage(ArraySegment<byte>, BufferManager) void WriteMessage(Message message, Stream stream) Message ReadMessage(Stream stream, int maxSizeOfHeaders) BufferManager.CreateBufferManager(long maxBufferPoolSize,int maxSize) BufferManager is a Byte pooling abstraction to use with encoders or to buffer data from the network ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Unit of Data Transfer Framing Message Bytes Need to encapsulate certain information outside of the SOAP message Byte Length of Data Content Type & Uri for Channel Method: 4 byte size, then data my.tcp://kennyw2/a/ text/xml 19 386 8 channel.Open() CreateChannel(“my.tcp://kennyw2/a/”) channel.Send(message)

Sockets vs. Channels (Service) 3/25/2017 8:53 AM Sockets vs. Channels (Service) Socket Channel new Socket(); listenSocket.Bind(IP, port); listenSocket.Listen(); BuildChannelListener<T>(Uri); listener.Open(); Socket = listenSocket.Accept() IChannel = listener.AcceptChannel(); socket.Receive(byte[]) Message = channel.Receive() socket.Close() channel.Close() Highlight: Addressing differences (IP+port vs. Uri) Unit of data differences (bytes vs. Message) Sharing Listeners among Base addresses In the PDC bits this is IListenerFactory+IListener InnerChannelListener CanCreateListener CreateListener [SetUri/SetUniqueUri being replaced with parameter to Binding.BuildListenerFactory()] Unit of Data Transferred Addressing Shutdown Accept Client Service ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Building a TCP Transport 3/25/2017 8:53 AM Building a TCP Transport ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Outline Writing a TCP transport Writing a chunking protocol channel Wrap up and Q&A

What We Will Show You 3/25/2017 8:53 AM ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Managing Inner Channel State 3/25/2017 8:53 AM Managing Inner Channel State Open Open inner channel Wait for pending sends, if any Drain session, if applicable Close inner channel Close As a protocol channel, you will have a lower channel or an inner channel which is the next channel below you in the stack. So when your state changes, you need to manage the state of that inner channel. Code: See region named StateMachine in ChunkingDuplexSessionChannel. OnOpen checks that state is Created then calls Open on input and output channels and then on inner channel. Similarly, OnClose checks that state is Opened then calls Close on output and input channels then on inner channel. Note that ChunkingOutputChannel.OnClose waits for any pending sends. Finally, OnAbort just calls Abort on the output, input and inner channels. Abort Abort inner channel ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Handling Inner Channel Events 3/25/2017 8:53 AM Handling Inner Channel Events Opened Opening Useful for reacting to state transitions when your code is not driving the channel Closing Closed Just as you need to manage the state of your inner channel when your state changes, you also need to react when the state of the inner channel changes on its own. Typically, protocol channels drive their inner channel’s Opening and Closing so you typically don’t need to handle those events. However, you typically need to handle the Faulted event (which indicates the inner channel has fauled) and either recover from the fault or fault your protocol channel. Faulted When inner channel faults, your channel should recover or fault ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Message Message is the unit of I/O in Indigo Message Headers 3/25/2017 8:53 AM Message Message is the unit of I/O in Indigo Based on XML InfoSet Consists of headers and body Message Headers Buffered, random access collection Used to implement infrastructure protocols Message Body Forward-only cursor Used to carry application data As you may have seen in Don’t talk yesterday, Message is the fundamental unit of I/O in Indigo. It is based on the XML infoset and consists of headers and body. Headers are represented in a buffered, randomly accessible collection and typically used for infrastructure protocols. Body on the other hand is represented as a forward only/read only cursor and typically used to carry application data. ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Working With Message Reading body content Creating messages using BodyWriter Reading and writing headers Creating messages using XmlDictionaryReader Custom messages

Configuring Channels Binding Element Configuration 3/25/2017 8:53 AM Configuring Channels Binding Element Configuration ChunkingBindingElement App Code Properties Chunking Configuration Section Policy Import Can be exposed to Config, Policy, or directly to Code This slide is all about binding elements as builders 2) NOTE: Bindings are not thread-safe, though the runtime objects (that they build) are WS-Policy .config ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Configuring Channels Custom Behaviors 3/25/2017 8:53 AM Configuring Channels Custom Behaviors Custom Behavior BindingParameters BindingElement ChannelFactory ChannelListener ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Using The Chunking Channel 3/25/2017 8:53 AM Using The Chunking Channel ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Please fill out the evaluation We want to know what you think! Key Take Aways Write custom channels when you need to Change what goes on the wire Integrate with arbitrary systems Enable new transports Channel extensibility is an opportunity for component vendors Please fill out the evaluation We want to know what you think!

Community Resources At PDC After PDC 3/25/2017 8:53 AM Community Resources At PDC COM429: A Deep Dive into Extending the Service Model Layer (Fri 10:30am) COM413: IIS and Windows Communication Foundation (“Indigo”): Hosting Services (Fri 1pm) Labs: COMHOL29 Ask The Experts table: Extending WCF COM Track lounge: We’ll be there Thu 5-6pm, Fri 8:30-noon After PDC If you missed this related session, watch it on the DVD COM424: WCF: A Deep Dive into Extending the Channel Layer MSDN dev center: http://msdn.microsoft.com/webservices/ MSDN Forum: Windows Communication Foundation ("Indigo") http://www.kennyw.com/indigo/ http://blogs.msdn.com/yassers/ Channel 9 tag: http://channel9.msdn.com/tags/Indigo/ ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

© 2005 Microsoft Corporation. All rights reserved. 3/25/2017 8:53 AM © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.