際際滷

際際滷Share a Scribd company logo
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
AGENDA
 Review
 Whats New
 Discovery
 Tracing
 Break
 Failover (routing)
 Protocol bridging (routing)
 REST
 Q&A
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
ABCS OF WCF
 Address
 Binding
 Contract
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
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
WHATS NEW IN 4.0
 VS2010 Training Kit labs
 Zero-configuration services
 Default behaviors & bindings
 Fileless activation (IIS/WAS)
 Standard endpoints
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
STANDARD ENDPOINTS
 Well-known infrastructure & application service types
 Designated by kind attribute
 Specify no binding, no contract  well-known
DEFAULTS
 Default behavior - unnamed behavior
 Default binding  protocol mappings
DISCOVERY  WS-DISCOVERY
DISCOVERY  WINDOWS RALLY
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
AD HOC DISCOVERY - UDP
TRACING
 WCF trace logs
 Network (netmon, Wireshark)
MANAGED DISCOVERY
MANAGED DISCOVERY
MANAGED DISCOVERY  MS
STYLE
BRIDGING
 System.ServiceModel.Routing
 <routing /> in .config
 Filters & filterType
FAILOVER
 <backupLists /> in <routing /> in .config
 backupList per filter
REST
 REST Hands On Labs
 REST Starter Kit  obsolete?
 Fileless activation
RESTFUL URIS
 URI templates
 Old  .svc breaks REST URI protocol
 New  better but not perfect
 URL Routing or URL Rewriting
Q&A
UPCOMING EVENTS
 CloudCamp
 GiveCamp (Will Platnick, ActiveHost)
 Code Camp

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
  • 2. AGENDA Review Whats New Discovery Tracing Break Failover (routing) Protocol bridging (routing) REST Q&A
  • 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
  • 4. ABCS OF WCF Address Binding Contract
  • 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
  • 10. DEFAULTS Default behavior - unnamed behavior Default binding protocol mappings
  • 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
  • 15. TRACING WCF trace logs Network (netmon, Wireshark)
  • 18. MANAGED DISCOVERY MS STYLE
  • 19. BRIDGING System.ServiceModel.Routing <routing /> in .config Filters & filterType
  • 20. FAILOVER <backupLists /> in <routing /> in .config backupList per filter
  • 21. REST REST Hands On Labs REST Starter Kit obsolete? Fileless activation
  • 22. RESTFUL URIS URI templates Old .svc breaks REST URI protocol New better but not perfect URL Routing or URL Rewriting
  • 23. Q&A
  • 24. UPCOMING EVENTS CloudCamp GiveCamp (Will Platnick, ActiveHost) Code Camp

Editor's Notes

  • #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.
  • #19: Work through Exercise 7.
  • #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
  • #22: Demo fileless activation
  • #23: Do REST Lab 1. Do REST Lab 2. Show WCF REST Service Template using routes instead of URL Rewrite.