First Look at Indigo


Presentation Description

No description available.


Presentation Transcript


Mathias Olausson Solutions Architect, Callista Knowledgebase AB

A first look at Indigo aka. Windows Communication Foundation: 

A first look at Indigo aka. Windows Communication Foundation Introduction Fundamentals Programming WCF Writing a simple WCF application

Callista Knowledgebase: 

Callista Knowledgebase Offers solutions on the Microsoft platform Architecture and design Training and mentoring Development resources Microsoft Partner Certified Professionals Certified Trainers Part of the Callista network



What is WCF?: 

What is WCF? Unified programming model for building connected applications Platform for advanced Web Services Standards based Building secure, reliable, transacted solutions Scale-invariant 'Pay-as-you-go' model Interoperability with existing investments Integration across platforms Client or server side component


Timeline 2003 October PDC CTP 2005 March CTP May Beta 1 RC August Beta 1 (Windows Vista) 2006 Windows Vista = WCF v1

Supported platforms: 

Supported platforms Windows XP SP2 Windows Server 2003 Windows Vista Windows Server 'Longhorn'


Requirements .NET framework 2.0 WinFX beta1 andlt;-andgt; Visual Studio 2005 beta 2 IIS 5.1, 6.0, 7.0 Installed before WinFX WinFX runtime VS 2005 Extensions for WinFX MSMQ 3.5 'Indigo' Beta 1 MSMQ Support Package The 'Indigo' Beta 1 MSMQ Support Package is an update to MSMQ to allow developers using Windows XP and Windows Server 2003 to create applications that use the 'Indigo' queued channels feature. COM+ Hotfix for 'Indigo' This QFE package adds support for the WS-AtomicTransaction protocol to MSDTC and support for the 'Indigo' COM+ Integration feature.

Unified (superseded) technologies: 

Unified (superseded) technologies ASMX Minor changes required WSE 2.0 Migration to WSE 3.0 (Wire-compatible) Currently in CTP release for VS 2005 .NET Remoting Re-write, no upgrade path Enterprise Services, COM+ Re-write or interoperability MSMQ Integration or interoperability


Interoperability Supports first and second generation web services Interop with ES and MSMQ Can act both as server and client

Interoperability – protocols: 

Interoperability – protocols HTTP1.1 MTOM SOAP1.1 SOAP1.2 WSDL 1.1 WSS SOAP Message Security 1.0 WSS SOAP Message Security Username Token Profile 1.0 WSS SOAP Message Security X509 Token Profile 1.0 WSS SOAP Message Security Kerberos Token Profile 1.0 WS Addressing 2004/08 WS Atomic Transactions WS Coordination WS Metadata Exchange WS Policy WS Policy Attachments WS Reliable Messaging WS Secure Conversation WS Transfer WS Trust



WCF Fundamentals: 

WCF Fundamentals Endpoints Behavior Runtime Hosting Configuration Metadata Diagnostics Mappings to SOA


Endpoints The unit of communication The ABC of WCF Address – where to expose Binding – how to expose Contract – what to expose Defined in code or in configuration Use configuration wisely


Address Defines where a service is located Specifies a URI where the service is located Relative or absolute Address concist of Scheme HTTP, TCP, Named pipes, MSMQ Machine [Port] Path Examples net.tcp://mycomputer:9000/StoreFront


Binding Describes how a service communicates Specifies set of binding elements Transport; http, tcp, np, msmq Encoding format; text, binary, MTOM, ... Security requirements Reliable session requirements Transaction requirements Nine predefined standard bindings Can be customized Custom binding

Standard bindings: 

Standard bindings

Custom bindings: 

Custom bindings Allows Specifying Custom Protocol Stacks Built from Ordered Set of Binding Elements [ContextFlowBindingElement] [ReliabilityBindingElement] [SecurityBindingElement] [CompositeDuplexBindingElement] TransportBindingElement HTTP, TCP, Named Pipes, MSMQ MessageEncoderBindingElement Text, Binary, MTOM


Contract Defines what a service communicate Supports contract first or code first models Contract first = interfaces May use WSDL first as well Message vs. RPC style APIs Service contract Data contract

Service contracts: 

Service contracts Describes what a service does Maps CLR types to WSDL [ServiceContract] defines the service contract [OperationContract] specifies operations One-way, request-reply, duplex MEPs

Data contracts: 

Data contracts Defines data structures Maps CLR types to XML Schema [DataContract] specifies types [DataMember] specifies members Can be applied to private fields! Built-in support for versioning


Behavior Modifies or extends service or client runtime behavior Examples Instancing; Singleton, PrivateSession, SharedSession, PerCall Concurrency; Multiple, Reentrant, Single Throttling; connections, threading Metadata Transactions; AutoEnlist, Isolation, AutoComplete

Composable Features: 

Composable Features Address Binding Behavior Contract HTTP Transport TCP Transport NamedPipe Transport MSMQ Transport Custom Transport WS-Security Protocol WS-RM Protocol WS-Coord Protocol Duplex Channel Custom Protocol http://... net.tcp://... net.pipe://... net.msmq://... xxx://... Throttling Behavior Metadata Behavior Error Behavior Custom Behavior Instancing Behavior Concurrency Behavior Transaction Behavior Security Behavior Request/ Response One-Way Duplex


Runtime Formats, sends and receives messages Dispatches message to service operation Attributes, code and config are used to dynamically create a ServiceHost instance Precedence: attribute, code, config


Hosting ASP.NET, .SVC format (andlt;%@Service %andgt;) IIS 6: HTTP transport only IIS 7: All transports Windows Activation Service, WAS Same process management, health, and activation features as IIS without requiring a Web server. Self hosted, ServiceHostandlt;Tandgt; Hosted in any CLR appDomain All transports IIS/WAS is the expected hosting model


Configuration Section in app.config or web.config The andlt;servicesandgt; Element serviceType. behaviorConfiguration The andlt;endpointandgt; Element address bindingConfiguration contractType The andlt;bindingsandgt; Element Contains the specifications for all bindings that can be used by any endpoint defined in any service.




Metadata Exposed through WS-MetadataExchange Endpoints Enabled by default, can be disabled through behavior Consumed using svcutil.exe Generates code and configuration Tool can also generate proxy class


Diagnostics Logging Request and reply messages Tracing End-to-end trace of [correlated] events WMI events Performance monitor counters Event Log

Mappings to SOA: 

Mappings to SOA Boundaries are Explicit Service and data contracts Services are autonomous Independent deployment, versioning, and security Share Schema, not Class Integration based on message formats and exchange patterns, not classes and objects Policy-based compatibility Service compatibility based on policy assertions (behaviors)


Programming WCF

Building a WCF application: 

Building a WCF application Application Design Service Define Contracts Implement Contracts Define Endpoints Host andamp; Run Service Client Generate Proxy from Metadata Implement andamp; Run Client

Application Design: 

Application Design

Application Design: 

Order Service Admin Client Application Design Order Client

Define Contracts: 

Define Contracts Service Contracts Order client and admin API (duplex) Data Contracts Shopping cart Item

Implementing Contracts: 

Implementing Contracts One class per service interface Class may specify ServiceBehavior attributes

Defining Endpoints: 

Defining Endpoints One per service interface wsProfileBinding, wsProfileDualHttpBinding Rember WCF ABC! Can be specified in code or configuration Configuration is to be preferred


Hosting Self hosted in console application One ServiceHost per ServiceType

Generating Proxies: 

Generating Proxies Generated dynamically from service svcutil.exe Note: service must be running Generate proxy and configuration files svcutil http://localhost:8000/StoreFront /out:proxy.cs /config:app.config Proxy Visual Studio add-in (community tool)

Implementing the Client: 

Implementing the Client Client configuration obtained from generated code Statless server calls Remember to close proxy correctly

Implementing the Admin Client: 

Implementing the Admin Client Again, client configuration obtained from generated code Duplex callback interface implementation Requires stateful connection!




Summary WCF is the next generation WS from Microsoft Know your ABC Define contracts first Supports building SOA But not limited to only that Unified programming model But be aware of consequences

Call to action!: 

Call to action! Download WinFx Beta 1 Includes .NET Framework 2.0, WCF (Indigo) Beta 1 and WPF (Avalon) Beta 1;displaylang=en WinFX SDK;displaylang=en WinFX Visual Studio 2005 extensions;displaylang=en


Resources Programming Indigo David Pallmann, MS Press, Windows Communication Foundation Introducing Indigo: An Early Look Newsgroup;lang=enandamp;cr=US

authorStream Live Help