Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Whats new in WCF 4.0


Published on

WCF 4 includes exciting improvements like simplified configuration, discovery, routing services and web HTTP programming. In this session we will explore those features and many more goodies that WCF 4 has to offer, and learn how to design and use the enhanced WCF 4 infrastructure.

  • Be the first to comment

  • Be the first to like this

Whats new in WCF 4.0

  1. 1. What’s New in WCF 4.0 Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog:
  2. 2. Agenda • Simplified Configuration • Discovery • Routing Services
  3. 3. Simplified Configuration
  4. 4. Simplified Configuration
  5. 5. Kind Attribute • Set the type of the standard endpoint <service name="HelloService"> ... <endpoint binding="webHttpBinding" contract= "IService1" kind= "webHttpEndpoint" /> <endpoint kind="mexEndpoint" /> No need in <endpoint kind="webHttpEndpoint" /> bindingConfiguration </service> endpointConfiguration
  6. 6. Custom Standard Endpoint • Standard endpoint must be registered in the <endpointExtensions> section. <system.serviceModel> <service name="HelloService"> <endpoint kind= "udpDiscoveryEndpoint" /> </service> <extensions> <endpointExtensions> <add name="udpDiscoveryEndpoint" type="..." /> </endpointExtensions> </extensions> </system.serviceModel>
  7. 7. Standard Endpoint
  8. 8. Service Discovery
  9. 9. Why We Need Discovery?
  10. 10. Async WCF Services
  11. 11. WS – Discovery Service Opened Hello Target Client Service Target Client Service Target Client Service
  12. 12. WS – Discovery Client Look for Service Probe Target Client Service Target Client Service Target Client Service
  13. 13. WS – Discovery Service Return Match Message Probe Match Target Client Service Target Client Service Target Client Service
  14. 14. WS – Discovery Service Closed By Target Client Service Target Client Service Target Client Service
  15. 15. Basic Discovery
  16. 16. Discovery Announcements
  17. 17. Routing Services
  18. 18. Router Service Architecture Client Router Filter Filters Service Tables Server A Service A Service B Service C Server B Server C
  19. 19. Router Endpoints & Contracts <service name ="System.ServiceModel.Routing.RoutingService"> <endpoint name = "reqReplyEndpoint" address = "" binding = "basicHttpBinding" contract = "System.ServiceModel.Routing.IRequestReplyRouter" /> </service>
  20. 20. Configuring Filters • The RouterService evaluates filters to determine how to forward the message. <serviceBehaviors> <behavior> <routing filterTableName="MyRoutingTable" /> <routing> </behavior> <filters> </serviceBehaviors> <filter name="MatchAllFilter1" filterType="MatchAll" /> </filters> <filterTables> <filterTable name="MyroutingTable"> <add filterName="MatchAllFilter1" endpointName="CalculatorService" /> </filterTable> </filterTables> <client> </routing> <endpoint name="CalculatorService" address="http://..." binding="basicHtttpBinding" contract="*" > </client>
  21. 21. Routing Services
  22. 22. Error Handing • You can define different lists of alternate endpoints that will be used if communicating with the initial target endpoint results in an error. <routing> ... <filterTable name="MyroutingTable"> <add filterName ="f1" endpointName ="t1" backupList ="altEndpoints" /> </filterTable> ... <backupLists> <backupList name="altEndpoints"> <add endpointName="CalculatorService2"/> </backupList> </backupLists> </routing>
  23. 23. Multicast Routing Behavior • Supports automatically routing a particular incoming message to multiple destinations in a “multicast” fashion. <routing> <filters> <filter name="Filter1" filterType="MatchAll" /> </filters> <filterTables> “Multicast” <filterTable name="MyroutingTable"> <add filterName="Filter1" endpointName="Target1" /> <add filterName="Filter1" endpointName="Target2" /> <add filterName="Filter1" endpointName="Target3" /> </filterTable> </filterTables> </routing>
  24. 24. Summary • Simplified Configuration • Discovery • Routing Services
  25. 25. Resources • • A Developer’s Introduction to WCF 4 Beta 1 • Service Configuration Improvements in .NET 4 • What’s New in WCF 4.0? • Jesus Rodriguez's WebLog