Upload
adam-weaver
View
213
Download
1
Tags:
Embed Size (px)
Citation preview
What’s New in WCF 4.5?
Richard Blewett
Rock Solid Knowledge Ltd
DEV326
Agenda
The big pictureSimplificationModern communication
The Big Picture
3.0Initial Release
2006
3.5Web Programming
2008
3.5 SP1POCO Support
2009
4.0Simplification and Routing
2010
4.5Simplification
and Communication
2012
Simplification
Configuration simplificationContract firstFlat WSDLNew async model
Configuration Simplification
WCF 4.0 simplified server configDefault endpointsDefault binding configDefault behaviors
WCF 4.5 simplfies client configAdd Service Reference only generates necessary config
Contract First
Implement service based on existing WSDLGood model for interopUseful for integration callbacks – e.g. Salesforce notification
WSDL Svcutil /sc <wsdl>Service
Contract and Data Contracts
Flat WSDL
4.0 WSDL contains schema imports for message definition
Can cause interop problemsSometimes import address isn’t routable
4.5 can generate flat WSDLAll constructs at one Uri
http://<metadata address>?singleWsdl
Task based async
Async always supportedClient uses APM or EAPServer uses APM
4.5 introduces Task based asyncSame pattern client and serverIntegrates with async/await
Async on the Client
Add Service Reference builds Async methods on proxy by default
[ServiceContract]public interface ITweetStats { [OperationContract] int GetTweetCount(string searchTerms); [OperationContract] Task<int> GetTweetCountAsync(string searchTerms);}
Async on server
Far more elegant than APM
[ServiceContract]interface ITweetStats { [OperationContract] Task<int> GetTweetCount(string searchTerms);}
public async Task<int> GetTweetCount(string searchTerms){ // ... HttpWebRequest req = WebRequest.CreateHttp(uri);
WebResponse resp = await req.GetResponseAsync(); // ...}
demo
WCF 4.5 Async Support
Modern Communication
Metro ClientsUDPWebSocketsNetHttpBinding
Metro clients
WCF client side available for Metro applicationsBasicHttpBindingNetTcpBindingNetHttpBinding (more on this shortly)
Proxy tuned for MetroOnly async methodsDuplex methods as events
No config filePartial method ConfigureEndpoint
UDP
RFC 768 – User Datagram ProtocolConnectionlessUnreliableBroadcast
WCF support based on SOAP over UDPhttp://specs.xmlsoap.org/ws/2004/09/soap-over-udp/soap-over-udp.pdfText Encodersoap.udp addressing scheme
demo
UDP Broadcast
Web Sockets
http://www.w3.org/TR/websockets/Port 80 or 443Full duplex over single connection
WCF support Requires Windows 8 / Windows Server 2012Microsoft.WebSockets Nuget package for browser based clients
demo
WebSockets to the Browser
NetHttpBinding
Productionization of the NetHttpBinding SampleBasicHttpBinding with binary encoder
Supports HTTP based duplex over single connectionUses WebSockets for duplexRequires Windows 8 / Windows Server 2012
demo
WebSockets to Metro Client
And more …
Streaming enhancementsConfig intellisense and tooltipsConfig validationRevised quota defaultsMultiple authentication modes in IIS hosting
Conclusion
.NET 4.5 makes WCF development easier
.NET 4.5 makes WCF development richer
Resources
Connect. Share. Discuss.
http://europe.msteched.com
Learning
Microsoft Certification & Training Resources
www.microsoft.com/learning
TechNet
Resources for IT Professionals
http://microsoft.com/technet
Resources for Developers
http://microsoft.com/msdn
Evaluations
http://europe.msteched.com/sessions
Submit your evals online
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to
be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS
PRESENTATION.