Mathias Olausson Solutions Architect, Callista Knowledgebase AB mocallista'se http:olausson'netblog - PowerPoint PPT Presentation

1 / 45
About This Presentation
Title:

Mathias Olausson Solutions Architect, Callista Knowledgebase AB mocallista'se http:olausson'netblog

Description:

Unified programming model for building connected applications ... Windows Server 'Longhorn' 8. Requirements .NET framework 2.0 ... – PowerPoint PPT presentation

Number of Views:81
Avg rating:3.0/5.0
Slides: 46
Provided by: shyc
Category:

less

Transcript and Presenter's Notes

Title: Mathias Olausson Solutions Architect, Callista Knowledgebase AB mocallista'se http:olausson'netblog


1
  • Mathias OlaussonSolutions Architect, Callista
    Knowledgebase ABmo_at_callista.sehttp//olausson.ne
    t/blog/

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

3
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
  • http//knowledgebase.callista.se/

4
Introduction
5
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

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

7
Supported platforms
  • Windows XP SP2
  • Windows Server 2003
  • Windows Vista
  • Windows Server Longhorn

8
Requirements
  • .NET framework 2.0
  • WinFX beta1 lt-gt 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.

9
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

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

11
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

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

14
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

15
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
  • http//www.mystore.com/StoreFront
  • net.tcp//mycomputer9000/StoreFront

16
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

17
Standard bindings
18
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

19
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

20
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

21
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

22
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

23
Composable Features
Contract
Behavior
Binding
Address
HTTPTransport
WS-SecurityProtocol
http//...
Throttling Behavior
InstancingBehavior
Request/Response
TCP Transport
WS-RMProtocol
net.tcp//...
MetadataBehavior
ConcurrencyBehavior
NamedPipeTransport
WS-CoordProtocol
net.pipe//...
One-Way
Error Behavior
TransactionBehavior
MSMQTransport
DuplexChannel
net.msmq//...
CustomBehavior
SecurityBehavior
Duplex
CustomTransport
CustomProtocol
xxx//...
24
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

25
Hosting
  • ASP.NET, .SVC format (lt_at_Service gt)
  • 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, ServiceHostltTgt
  • Hosted in any CLR appDomain
  • All transports
  • IIS/WAS is the expected hosting model

26
Configuration
  • Section in app.config or web.config
  • The ltservicesgt Element
  • serviceType.
  • behaviorConfiguration
  • The ltendpointgt Element
  • address
  • bindingConfiguration
  • contractType
  • The ltbindingsgt Element
  • Contains the specifications for all bindings that
    can be used by any endpoint defined in any
    service.

27
Configuration
28
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

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

30
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)

31
Programming WCF
32
Building a WCF application
  • Application Design
  • Service
  • Define Contracts
  • Implement Contracts
  • Define Endpoints
  • Host Run Service
  • Client
  • Generate Proxy from Metadata
  • Implement Run Client

33
Application Design
34
Application Design
Admin Client
Order Client
Order Service
35
Define Contracts
  • Service Contracts
  • Order client and admin API (duplex)
  • Data Contracts
  • Shopping cart
  • Item

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

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

38
Hosting
  • Self hosted in console application
  • One ServiceHost per ServiceType

39
Generating Proxies
  • Generated dynamically from service
  • svcutil.exe
  • Note service must be running
  • Generate proxy and configuration files
  • svcutil http//localhost8000/StoreFront
    /outproxy.cs /configapp.config
  • Proxy Visual Studio add-in (community tool)

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

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

42
Summary
43
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

44
Call to action!
  • Download WinFx Beta 1
  • Includes .NET Framework 2.0, WCF (Indigo) Beta 1
    and WPF (Avalon) Beta 1
  • http//www.microsoft.com/downloads/details.aspx?Fa
    milyIdCE888B4C-CCBD-452F-9D90-F4B7190CCA24displa
    ylangen
  • WinFX SDK
  • http//www.microsoft.com/downloads/details.aspx?Fa
    milyID23a22468-5807-4ff7-a363-ce6fe69b8f04displa
    ylangen
  • WinFX Visual Studio 2005 extensions
  • http//www.microsoft.com/downloads/details.aspx?Fa
    milyId45F9BE99-3264-4BF1-8879-78A7A95D9217displa
    ylangen

45
Resources
  • Programming Indigo
  • David Pallmann, MS Press, http//www.microsoft.com
    /mspress/books/7703.asp
  • Windows Communication Foundation
  • http//msdn.microsoft.com/webservices/indigo/defau
    lt.aspx
  • Introducing Indigo An Early Look
  • http//msdn.microsoft.com/webservices/indigo/defau
    lt.aspx?pull/library/en-us/dnlong/html/introindig
    ov1-0.asp
  • Newsgroup
  • http//msdn.microsoft.com/longhorn/community/newsg
    roups/default.aspx?dgmicrosoft.public.windows.dev
    eloper.winfx.indigolangencrUS
Write a Comment
User Comments (0)
About PowerShow.com