what's new in wcf 4.5
DESCRIPTION
Windows Communication Foundation (WCF) is one of the leading technologies for building distributed applications. WCF 4.5 which ships with the new .NET 4.5 and Visual Studio 2012 introduces many new features that both simplifies the way we create services and enables us improve the way our services work. In this session we will see many of the new features offered by WCF 4.5 – configuration Intellisense, cleaner configuration for IIS, UDP and WebSockets supports, and many more.TRANSCRIPT
What’s New in WCF 4.5
Ido Flatow, Senior Architect
Sela Group
This presentation:http://sdrv.ms/1b94Zmb
About Me
• Senior architect, Sela Group• Co-author of:
– Developing Windows Azure and Web Services – Microsoft official course
– WCF 4 – Microsoft official course– Pro .NET Performance – Apress
• Microsoft MVP• Focus on server, services, and cloud
technologies• Manager of the Israeli Web Developers User
Group
What is WCF?
• WCF is a unified .NET framework for building service-oriented applications
• WCF was introduced in .NET Framework 3.0 and extended in .NET 3.5, .NET 4, and .NET 4.5
• WCF is the foundation for other Microsoft distributed technologies
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Do You Like WCF?http://twitter.com/#!/search/%23wcf%20config
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Common WCF Configuration Issues
• Using wrong service / contract names• Need to remember binding names • Copy & pasting configuration names• Configuration duplication for WCF and IIS
• Some configuration issues were addressed in WCF 4
• Visual Studio 2012 & WCF 4.5 continue the simplification process
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Image: chanpipat / FreeDigitalPhotos.net
Visual Studio 2012Editor Simplification
• IntelliSense– Service name– Contract name– Binding type
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Visual Studio 2012Editor Simplification
• IntelliSense– Service name– Contract name– Binding type– Binding configuration– Behavior configuration
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Visual Studio 2012Editor Simplification
• IntelliSense– Service name– Contract name– Binding type– Binding configuration– Behavior
configuration
• Tooltips• Compile-time
validations
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Cleaner Endpoint Configuration for IIS• Multiple IIS authentication types in one binding
– Bindings can inherit authentication types from IIS– Instead of multiple endpoints, declare just one!– Set the binding’s clientCredentialType to InheritedFromHost
• New default endpoint for HTTPS– No need to declare endpoints if using both HTTP and HTTPS – Default HTTPS endpoints don’t require client credentials– Customize default endpoints in the ProtocolMapping section
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
What Other Mess Got Cleaned Up?
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
Excessive Generated ConfigurationSimplified Client Configuration
SIMPLIFYING WCFDEMO
Duplex Communication with HTTP
• HTTP is a request-response protocol• Updates are through server polling
– Periodic polling (Anything new?)– Long polling (I’m waiting for you!)
• Many disadvantages– Periodic polling inflicts high-latency on updates– Long polling is hard to implement– Can cause bandwidth overhead if used
improperlyJoin the conversation on Twitter: @SoftArchConf #SoftArchConf
WebSockets in a Glance
• Bi-directional TCP channel (full-duplex)• Supports both HTTP and HTTPS (SSL)• Accessible through JavaScript API• Supports cross-domain calls• Client-side - IE10, Chrome, Firefox, WCF 4.5• Server-side – IIS 8, ASP.NET 4.5, WCF 4.5• Standardization is still in progress!!
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
WebSockets and WCF 4.5
• WCF 4.5 supports WebSockets in two modes:– SOAP over WebSockets (.NET)– Plain text over WebSockets (browsers)
• For SOAP use NetHttpBinding• For browsers, use the Microsoft.WebSockets NuGet
package– Create a service class by inheriting from WebSocketService– Implement control methods – OnOpen, OnStop,
OnMessage, OnError– Send messages to client by calling the Send method
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
DUPLEX WCF WITH WEBSOCKETSDEMO
WCF and UDP – Q&A
• WCF 3.5– “Does WCF support UDP bindings?”– “Not out-of-the-box, but there is an MS sample for that”
• WCF 4 – “Does WCF support UDP?”– “Not out-of-the-box, but there is an MS sample for that”– “But Discovery uses UDP, right?”– “Indeed, but the UDP transport channel is internally used”
• WCF 4.5– “Does WCF support UDP?”– “YES!!”
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
UDP Transport
• New UDP binding out-of-the-box• Supports one-way and request-response• Unicast – you do not get an exception if host is down!!• Multicast messaging is supported through IPs such as
224.0.0.1 – 239.255.255.255• Supported features are basic
– Only text encoding– No sessions– No security– No duplex
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
COMPARING HTTP, TCP, AND UDPDEMO
Improved Channels and Encoding
• Web hosting (IIS)– Fixed streamed messages from being buffered in ASP.NET– Added async streamed reply for slow reading clients
• Self hosting– Support for binary encoding compression (Gzip / Deflate)– Works with TCP and custom HTTP transports
• Both hosting environment– New transport defaults for TCP and named pipe transports– Defaults are now multiplied by #cores to enable
high-density scenarios
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
TRANSPORT IMPROVEMENTSDEMO
To Conclude
• Yet another effort to simplify the creation of WCF services and clients
• Continuing to support new and existing standards
• Striving to improve the overall performance of WCF
Join the conversation on Twitter: @SoftArchConf #SoftArchConf
WCF ResourcesWCF Home and Forum
msdn.microsoft.com/en-us/library/dd456779.aspxsocial.msdn.microsoft.com/forums/en/wcf
WCF Blogsblogs.msdn.com/b/piyushjo
blogs.msdn.com/b/carlosfigueira WCF vNext UserVoicetinyurl.com/wcfvnext
My Infoblogs.microsoft.co.il/blogs/idof
[email protected]@idoFlatow
This presentation: sdrv.ms/1b94Zmb