Lukáš Kubis
[email protected] MSP pro VŠB-TU Ostrava
Agenda Simplified Configuration Discovery
Routing Service Other Features
WCF
Service Communication Service 1 Caller
Service 2 Message
Message
Service
A Look at WCF: Endpoints
Client
Service Endpoint
Endpoint
Message
Endpoint
A Look at WCF: Address, Binding, Contract
Client
Service
C
B
A
Message
A
B
C
A
B
C
Address
Binding
Contract
(Where)
(How)
(What)
Metadata Metadata
Caller
Service
C
B
A
Message
A
B
C
A
B
C
Behaviors Metadata
Caller
Service
Bv Bv
C
B
A
Message
A
B
C
Bv
A
B
C
Bv
Runtime Metadata
Caller
Service
Bv Bv
C
Proxy
B
A
Message
A
B
C
Bv
A
B
C
Bv
ServiceHost
()
WCF - Service - Host - Client
AGENDA
Simplified Configuration Discovery
Routing Service Other Features
Simplified Configuration • • • • • •
Default Endpoints Default Protocol Mapping Default Binding Configurations Default Behavior Configurations Standard Endpoints Simplifying IIS/ASP.NET Hosting
Default Endpoints
new Uri(“http://localhost:8090/Service”)
Service
ServiceHost()
App.Config
Default Endpoints
new Uri(“http://localhost:8090/Service”)
Service
AddServiceEndpoint(…)
NO DEFAULT ENDPOINTS ServiceHost()
AddDefaultEndpoints(…)
Default Protocol Mapping • Mapovací tabulka (http - basicHttpBinding) • Machine.config
Default Protocol Mapping • Defaultní mapování – Lokální – Globální
• Lokální – v souboru app.config/web.config • Globální – Beta 1 – v souboru machine.config – Beta 2 – mapování odebráno z machine.config z výkonnostních důvodů !!!
Default Binding Configurations
Bez atributu NAME !!!
Default Binding Configurations
Default Behavior Configurations
Bez atributu NAME !!!
Default Behavior Configurations
Standard Endpoints kind=“endpointName” Název
Popis
mexEndpoint
mexHttpBinding, IMetadataExchange
announcementEndpoint
Pro funkcionalitu oznámení
discoveryEndpoint
Pro operace hledání (Find, Resolve)
udpAnnouncementEndpoint
Pro funkcionalitu oznámení přes UDP
udpDiscoveryEndpoint
Pro operace hledání (Find, Resolve) přes UDP
workflowControlEndpoint
Pro kontrolu vykonávaní workflow
webHttpEndpoint
webHttpBinding a webHttpBehavior
webScriptEndpoint
webHttpBinding a webScriptEnablingBehavior
- Default Endpoints - Protocol Mapping - Binding Configurations - Behavior Configurations
AGENDA
Simplified Configuration Discovery
Routing Service Other Features
Discovery • Dva módy: – AD hoc mód – v lokálním subnetu – Managed mód
• Využívá WS-Discovery protokol http://en.wikipedia.org/wiki/WS-Discovery
Discovery Service
Service
Service
IService2
IService3
Message IService1
Service IService4
Chci službu Message Message IService1 MessageMessage
Client
Discovery Service Endpoint
Service
Endpoint
Discovery Client Endpoint
Client
Endpoint
1. DiscoveryClient 2. FindCriteria 3. FindResponse Find, void FindAsync
Discovery – AD Hoc mode
Discovery Scopes
Discovery Scopes
EndpointBehavior
Discovery - Scopes
Discovery Extension Metadata
• Lze přidat doplňují informace (např. uživatelské jméno)
Discovery - Extension Metadata
Discovery Announcements
Discovery Announcements
App.config
Discovery Announcements
Discovery - Announcements
Discovery Managed mode
Discovery Managed mode
• Není omezen na lokální subnet (AD Hoc mode) • Potřebné 2 endpointy: – UdpAnnounecementEndpoint (online/offline) – UdpDiscoveryEndpoint
Discovery
Kenny je „Zabili online – žije Kennyho ?“ …
Managed mode
Discovery Proxy
Message
Discovery - Managed Mode
AGENDA
Simplified Configuration Discovery
Routing Service Other Features
Routing Service Service1
Caller Message
Router Message Message
Service2
Routing Service • WCF 3.x – Neexistovala oficiální podpora – Pomocí API lze vytvořit vlastní „routing services“
• WCF 4.x – Oficiální podpora !!! – Nová třída – RoutingService
Routing Service Hostování
Service A A
B B
C C
• Address • Binding • Contract – – – –
ISimplexDatagramRouter ISimplexSessionRouter IRequestReplyRouter IDuplexSessionRouter
Routing Service Filtry
• • • • • • • •
Action EndpointAddress PrefixEndpointAddress And Custom EndpointName MatchAll XPath
RoutingService
Protocol Bridging
Service
Router
Caller wsHttpBinding
netTcpBinding
AGENDA
Simplified Configuration Discovery
Routing Service Other Features
Other Features • REST Improvements – Automatic Help Page – HTTP Caching Support
• Workflow Services • …
SUMMARY
Simplified Configuration Discovery
Routing Service Other Features
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.