The document summarizes a presentation about new features in Windows Communication Foundation (WCF) in .NET 4.0, including discovery, failover, bridging, and REST support. The presentation covers topics like WS-Discovery, managed and ad hoc discovery using UDP, tracing, routing, backup lists for failover, protocol bridging, and REST with URI templates. It also mentions the presenter's employer Apprenda and how it helps transform single-tenant applications to be multi-tenant using WCF.
1 of 24
Downloaded 23 times
More Related Content
WCF in .NET 4.0 - TVUG November 2010
1. WCF: ITS
BAAACK
Tech Valley .NET User Group
November 2010
Andy Badera andrew@badera.us
Client Services, Apprenda, Inc.
WCF in .NET 4.0
Discovery, failover, bridging &
REST
3. APPRENDA & SAASGRID
VC-backed ($6.5M) startup in Clifton Park hiring!
Scalable SaaS-enablement platform & WCF grid for .NET
Transform single tenant apps -> multitenant
We reduce your time to market/revenue
Heavy manipulation of WCF configuration
Inject endpoints for grid awareness/participation
Inject behaviors for session management and
tenancy/subscription enforcement
5. HOSTING WCF
IIS (HTTP/S)
Within a WCF application (WinForms, WCF; P2P, rich clients)
Hosted by a Windows service
WAS (non-HTTP via IIS model)
AppFabric
6. WCF DEVELOPMENT/DEBUGGING
C:Program Files (x86)Microsoft Visual Studio
10.0Common7IDE
WcfTestClient
C:Program FilesMicrosoft SDKsWindowsv7.1Bin
SvcUtil proxy autogenerator Add Service Reference
SvcConfigEditor WCF Service Configuration Editor
SvcTraceViewer
7. WHATS NEW IN 4.0
VS2010 Training Kit labs
Zero-configuration services
Default behaviors & bindings
Fileless activation (IIS/WAS)
Standard endpoints
8. WHATS NEW IN 4.0
Discovery (WS-Discovery)
http://docs.oasis-open.org/ws-dd/discovery/1.1/wsdd-discovery-
1.1-spec.html
Routing
Failover
Protocol bridging
9. STANDARD ENDPOINTS
Well-known infrastructure & application service types
Designated by kind attribute
Specify no binding, no contract well-known
13. AD HOC DISCOVERY - UDP
System.ServiceModel.Discovery
Sync or Async
Broadcasts announcements
Well-known standard endpoints UdpDiscoveryEndpoint,
UdpAnnouncementEndpoint
Filtered by various criteria
Metadata System.ServiceModel.Description
#2: Who here has heard of WCF? Who here has used WCF? XML webservices? Who can tell me what SOAP stands for? Who has used RESTful webservices? Who can tell me what REST stands for?
#5: ABCs define an endpoint at a minimum the URI, port and binding of a service. Address is the URL and port. Binding is the transport protocol: http, https, net.tcp, etc. Contract is the contract, or interface, of the service being consumed.
#6: IIS ASP.NET-hosted .svc files; fileless activation
WAS message-based activation (RESTful URLs; MVC?)
Show self-hosting/service hosting?
Show WCF as ASMX trick?
Show .svc consumed by plain web/AJAX clients (AspNetCompatibility)
#7: YMMV on paths.
Enable metadata on previous configuration-less example. Browse by web. Create WcfTestClient client, invoke. Disable metadata. Browse by web. Invoke by client.
One of the trickier things with WCF, especially pre-4.0, is the complexity of configuration files. SvcConfigEditor makes it fairly simple to validate services, clients, behaviors & etc. as you add them through a GUI.
#8: Show 3.5 config.
Show configuration-less .svc deployment in 4.0.
#10: i.e. Mex is always IMetadataExchange
Mex EndpointA standard endpoint that is used to expose service metadata.
AnnouncementEndpointA standard endpoint that is used by services to send announcement messages.
DiscoveryEndpointA standard endpoint that is used by services to send discovery messages.
UdpDiscoveryEndpointA standard endpoint that is pre-configured for discovery operations over a UDP multicast binding.
UdpAnnouncementEndpointA standard endpoint that is used by services to send announcement messages over a UDP binding.
DynamicEndpointA standard endpoint that uses WS-Discovery to find the endpoint address dynamically at runtime.
ServiceMetadataEndpointA standard endpoint for metadata exchange.
WebHttpEndpointA standard endpoint with aWebHttpBindingbinding that automatically adds theWebHttpBehaviorbehavior
WebScriptEndpointA standard endpoint with aWebHttpBindingbinding that automatically adds theWebScriptEnablingBehaviorbehavior.
WebServiceEndpointA standard endpoint with aWebHttpBindingbinding.
WorkflowControlEndpointA standard endpoint that enables you to call control operations on workflow instances.
WorkflowHostingEndpointA standard endpoint that supports workflow creation and bookmark resumption.
#11: Is everyone familiar with WCF endpoint behaviors? Allows control of exception detail in error responses, service metadata, service discovery, timeouts, packet size and throttling for services and clients, myriad other facets of client and service behaviors.
Default behavior applies to any defined service that does not explicitly specify another behavior. Note: the configuration editor tool from the SDK does not appear to like empty name or null name values.
Default protocol mapping order is defined machine.config; can be overridden in machine.config, app.config, web.config. Default order in machine.config begins with basicHttp.
#12: All SOAP all metadata is XML, found throughout the messaging actions.
#14: Discovery criteria include contract types, binding elements, namespace, scope, and keywords or version numbers
#15: To find a service, clients send aProberequest that contains specific criteria such as service contract type, keywords, and scope on the network. Services receive theProberequest and determine whether they match the criteria. If a service matches, it responds by sending aProbeMatchmessage back to the client with the information necessary to contact the service. Clients can also sendResolverequests that allow them to find services that may have changed their endpoint address. Matching services respond toResolverequests by sending aResolveMatchmessage back to the client.
Work through Exercises 4-6; show next slide Tracing while work-in-progress.
#16: Show trace(s) on UDP discovery while working through Exercises 4-6.
#17: Utilizes a discovery proxy (dp).
Ad hoc and managed will exhibit different network traffic behaviors, so one or the other may be more appropriate or provide better results in various scenarios. (P2P vs. client-server with failover, etc.)
Up to the developer to understand the needs of their system; network profiling is a good tool.
#20: Generic, configurable SOAP intermediary. Updatable router config without service restart. Content-based XPath-driven routing.
Do Exercise 8. Note name RouterService needs to be CalculatorService for client to call the router service. Comment out net.tcp endpoint.
#21: Talk about failover
Do Exercise 10.
Show service, network? traces from failover