280 likes | 392 Views
AppFabric Series: A Lap Around WCF 4. Josh Harrison. WCF 4.0 Context. Overview of What’s New. Simplified configuration model Added functionality for Discovery, Routing, and REST. Configuration Updates.
E N D
AppFabric Series: A Lap Around WCF 4 Josh Harrison
Overview of What’s New Simplified configuration model Added functionality for Discovery, Routing, and REST
Configuration Updates WCF has been successful at shielding the developer from complexities around distributed communication implementation However, it has introduced a new complexity
Simplified Configuration Default Endpoints Default Bindings Default Behaviors Standard Endpoints
Default Endpoints If no endpoints are defined when a service is opened, WCF will infer at least one based on the base address and service type.
Protocol Maps can be modified <system.servicemodel> <protocolMapping> <add scheme=”http” binding=”wsHttpBinding” /> </protocolMapping> </system.servicemodel>
Default Behaviors/Bindings Unnamed binding or behavior configurations will be applied to services/endpoints that do not have named configurations
Standard Endpoints A short hand way of defining commonly used endpoints.
Standard Endpoints Example <system.servicemodel> <service> <service name=”Demo.TestService”> <endpoint kind=”mexEndpoint” /> …
Indirect Message Patterns “All problems in computer science can be solved by another level of indirection” –Butler Lampson
Routing “Messaging pattern used to decouple a message source from the ultimate destination of the message” -Enterprise Integration Patterns (Hohpe, Woolfe)
Routable properties Message Action Address prefix Message headers Endpoint address
Common Use Cases Network masquerading Protocol Bridging Multi-casting Content routing
Routing Message Exchange Patterns • Routing service is implemented via the RoutingService and supports four MEP contract types. • ISimplexDataGramRouter • IRequestReplyReplyRouter • ISimplexSessionRouter • IDuplexSessionRouter
Ad-Hoc Discovery UDP based broadcast on client’s subnet The “udpDiscoveryEndpoint” Standard endpoint can be used Similar to a server-less bind in Directory Services programming.
Ad-hoc code sample • Two ways to go about ad-hoc discovery • Dynamic Endpoint • Discovery Client varfindCriteria = FindCriteria.CreateMetaDataEndpointExchangeCriteria(typeof(Demo.ITestService)); findCriteria.MaxResults= 1; varfindResults = discoveryClient.Find(findCriteria);
Managed Discovery Clients discover services through an implemented proxy Proxy’s are implementations of an abstract base class DiscoveryProxy Services contact proxy when they start up and shut down
Improved Rest Support Help Page Behavior AspNetCacheProfile attribute WebFaultException New Project Templates
Works Cited and Referenced Juval Lowy - Programming WCF Services Aaron Skonnard – A Developer’s Introduction to Windows Communication Foundation 4 (MSDN) Jesus Rodriguez Weblog
Contact Info Email: josh.r.harrison@gmail.com Blog: www.JoshRHarrison.com LinkedIn: http://www.linkedin.com/in/joshrharrison Company: Leading EDJE