View
246
Download
0
Category
Preview:
Citation preview
Mi ft NET WCF Microsoft .NET - WCF and WPF
L M dLarry Mead
Microsoft Corporation
Co-branded Logo FootprintAligned LEFT ON COVER ONLYMust Fit Within This Space
Agenda
> Session overview
> Introducing the WCF Basic Concepts> Introducing the WCF Basic Concepts Demo
> Di ing into the WCF A chitect e> Diving into the WCF Architecture Demo
I t d i WPF> Introducing WPF Demo
WPF G hi> WPF Graphics Demo
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
> Summary
Session Overview
> .NET is more than C#, VB.NET and the CLR .NET also includes tools for system development
> This session is not an overview of .NET This session is an overview of the Windows
Communication Foundation (WCF) and Windows Presentation Foundation (WPF)Presentation Foundation (WPF)
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space3 September 23-25, 2009 Copyright © 2009 CA. All rights reserved.
Why WCF - The Connectivity Imperative
> Interoperability & Integration> Interoperability & Integration
> Secure, Reliable, Transacted Messaging
> Decoupled Dynamic Applications> Decoupled, Dynamic Applications
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
What is WCF?
>Unified framework for building interoperable service-oriented applications on the Windows l fplatform
>Platform Support and AvailabilityWindows
XPWindows
Server 2003
Vista &Windows 7
Windows Server
2008 & R2
Installs with
OperatingSystem
Availableas a
t
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
separate download
What are the key WCF drivers?
Unifies today’s distributed technology stacksIntegration with Visual Studio 2005 and
Productivity Integration with Visual Studio 2005 and
2008 Appropriate for use on-machine, cross
machine, and cross InternetC l tf i t bilit (WS*) Cross-platform interoperability (WS*)
Integration with existing Microsoft technologies
Interoperability
Service-oriented programming model Supports 4 tenets of service-
orientation
Service Oriented Development
Maximized productivity for building SOAs
web scenarios 1st class support for REST Web
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
1st class support for REST, RSS/ATOM, JSON
Web Programming
Introducing WCFg
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space7 September 23-25, 2009 Copyright © 2009 CA. All rights reserved.
Unification of Programming ModelsUnification of Programming Models
InteropInteropwith otherwith other
ASMX & WSE
ExtensibilityExtensibilityLocation Location
tt
.NET Remoting
Platforms & WSPlatforms & WS--**
AttributeAttribute--BasedBased
MessageMessage--OrientedOriented
transparencytransparency
BasedBasedProgrammingProgramming
Enterprise Services
REST / HTTP REST / HTTP ProgrammingProgramming
OrientedOrientedProgrammingProgramming
System.Messaging
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
HTTP Services
(*) New in .NET 3.5
WS* Protocol FrameworkInteroperability through open standards
M i
Security ReliableDelivery Transactions
Meta
da
Messaging
XML
ata
Transports
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
WCF Basic Principles
> Developers write services that respond to messagesWCF i t i id th CLR WCF services execute inside the CLR
WCF messages use SOAP model
Services expose addressable endpointsServices expose addressable endpoints
> Services implement contracts that describe messages being exchangedb g a g d Individual contracts are either structural (schema) or
behavioral (interface)
Contracts constrain message flow between initiator and service
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
AddressAddress Binding Contract(Where) (How) (What)
> Makes an EndPoint uniquely addressable
> Uri based http://localhost/myservice
//l lh / net.tcp//localhost/myservice
> Base address + relative path for each EP http://localhost/myservice
http://localhost/myservice/ep1
http://localhost/myservice/ep2 http://localhost/myservice/ep2
> Normally configured by the Administrator
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Bindings Address Binding Contract(Where) (How) (What)
> Bindings determine ‘how’ an endpoint is accessibleC fi th WCF C i ti I f t t Configure the WCF Communication Infrastructure
Transport, Encoding and (WS*) Protocols
WCF bli h bi di fi ti th h t d t> WCF publishes binding configuration through metadata
> Bindings are normally specified in configuration Can be specified in code as well
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Contracts Address Binding Contract(Where) (How) (What)
> Contracts describe the external view of a service
> Contracts are exposed through WSDL and XSD
> Contracts are explicitly defined, opt-in model
WCF Service
CLR types
cts
Interface
Co
ntr
ac
<xml….> Implementation
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Types of Contracts
> Service Contract Defines the operations of a service Defines the operations of a service
Each operation defines a Message Exchange Pattern (MEP)– OneWay, Request/Reply and Duplex
> Data Contract Structural “schemas” for data representations
> Fault Contract Defines errors/faults that a service may return so that
consumer applications can handle these situations more consumer applications can handle these situations more gracefully
> Message Contract
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
g Controls SOAP processing/data model
Metadata
> Describes the capabilities of a service
> Metadata consists of contracts (XSD, WSDL) and Policy
> Metadata can be published through: HTTP Get (baseaddress?wsdl)
WS-Metadata Exchange (MEX)b d l f h d– MEX is a SOAP based protocol for exchanging metadata
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Behaviors
> Behaviors determine the local client and service behavior
> Behaviors can be applied through code and configuration> Behaviors can be applied through code and configuration
> Developer vs. Administrator behaviors
Behavior Description
Instancing Specifies the number of instances of services available for handling a message
Concurrency Determines if a service supports single-threaded or multi-threaded modes of operation
Throttling Determines the maximum number of simultaneous i i i direquests, connections, service instances, pending
operations
Exception Handling Determine how exceptions are handled
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Security (Impersonations, Authorization), Local Transactions, custom, etc.
WCF Architecture
Client ServiceClient ServiceApplication Logic
Behavior BehaviorService Model Layer(Integration + local Service behavior)
Behavior
Behavior
Behavior
Behavior
Behavior
Behavior
Channel
Channel
E d
Messaging Layer(Messaging
Channel
Channel
E dEncoder
Transport Channel
(Messaging Infrastructure)
Encoder
Transport Channel
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Note: Configured through Bindings
WCF Scenarios
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space18 September 23-25, 2009 Copyright © 2009 CA. All rights reserved.
WCF CapabilitiesSecurity, Reliable Communication and Transaction
> Security Secure, simple and interoperable, p p Support for Message (WS*) and Transport level security
– Authentication, Authorization, Transfer security
> Reliable Messaging> Reliable Messaging WCF provides reliable communication over unreliable
infrastructure– SOAP based reliable sessions for connected
communicationcommunication– MSMQ based reliability for disconnected
communication
> Transactions> Transactions Transactions ensure Consistency WCF Transaction Scenarios
– Perform an Service Operation as a single transaction
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
– Perform an Service Operation as a single transaction– Flowing transactions across services
NET 3 0 NET 3 5 NET 4 0
Integration with IIS and WAS to enable
• Hosting WCF ser ice in Partial
• Activation of XAMLX ser ices
.NET 3.0 .NET 3.5 .NET 4.0
and WAS to enable
• WCF activation over http and
non-http transports
service in Partial Trust
• Activation of XOML services
XAMLX services• Config based
Activation• Default configuration
modeltransports• management of
services
model• Activate over multiple http base
address• Autostart
• System web• System.webIntegration
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Windows Presentation Foundation
A productive, unified approach to UI,
media and documents to deliver
unmatched user experience
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
WPF Key Scenarios
NextNext--Gen Windows Smart Client applications:Gen Windows Smart Client applications:pppp
I t ll d d kt li ti> Installed desktop applications
> Browser applications (XAML Browser Application)
> Common code base and flexible deployment
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Declarative Programming Through XAML
XAML = Extensible Application Markup LanguageXAML = Extensible Application Markup Language
• Easily toolable, declarative markup• Code and content are separate• Code and content are separate• Can be rendered in the browser/application
XAML C# VB.NET
<Button Width="100"> OK<Button.Background>
LightBlue</Button.Background>
</Button>
Button b1 = new Button();b1.Content = "OK";
b1.Background = new SolidColorBrush(Colors.LightBlue
);b1.Width = 100;
Dim b1 As New Buttonb1.Content = "OK"
b1.Background = New _
SolidColorBrush(Colors.LightBlue)
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
b1.Width = 100
Introducing WPFg
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space24 September 23-25, 2009 Copyright © 2009 CA. All rights reserved.
Controls, Templates, Styles & Resources, Layouts, Animation
Animation, Triggers, Timelines
<StackPanel><StackPanel.Triggers>
<EventTrigger RoutedEvent=“Button.Click">
<EventTrigger.Actions>
Templated Button
gg
<BeginStoryboard>
<BeginStoryboard.Storyboard>
<Storyboard>
<ColorAnimation To="Yellow" Duration="0:0:0.5“
Storyboard.TargetName="TheBrush"
UI Services
• TemplatesStoryboard.TargetProperty="Color" />
<DoubleAnimation To="45" Duration="0:0:2"
Storyboard.TargetName="LowerEllipseTransform"
Storyboard.TargetProperty="Angle" />
p
• Layout
• Controls Library
• Styles and ...
</StackPanel.Triggers>
… remainder of contents of StackPanel, including x:Name'd
TheBrush and LowerEllipseTransform …
/ k l
Styles and Resources
• Annotation
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
</StackPanel>
Data Binding
Layout & Databinding<StackPanel>
Binding Target
Binding Source
<Label>Select A Customer</Label>
<ListBox
Name="myListBox"
Background="HoneyDew"
ItemsSource="{Binding
{StaticResource myDataSource}}"
Dependency ObjectDependency Object ObjectObject
Dependency Property PropertyTwoWay
OneWay
OneWayToSource
> UI can be bound to CLR objects and XML
</ListBox>
</StackPanel>
> UI can be bound to CLR objects and XML
> Dependency properties can also be bound to ADO.NET and objects associated with Web Services and Web properties
> Sort, filter, and group views can be generated on top of the data
> Data templates can be applied to data
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
> Data templates can be applied to data
2D Graphics, 3D Graphics, Imaging
3D Graphics3D Graphics
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
WPF Graphicsp
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space28 September 23-25, 2009 Copyright © 2009 CA. All rights reserved.
Summary
> WCF is an unified framework for building service-oriented applications on the Windows platformapplications on the Windows platform WCF achieves unification via a composable architecture
Rich foundation for building secure and reliable distributed gsystems
Easy integration and migration path for existing applicationsapplications
> WPF is a declarative presentation framework for both rich client and browser user interfacerich client and browser user interface Supports the latest Vista and Windows 7 glass
Supports 2D and 3D graphics
Co-branded Logo FootprintAligned Right Edge
Must Fit Within This Space
Includes support of latest Office and Windows tools
Recommended