25

What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

Embed Size (px)

Citation preview

Page 1: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326
Page 2: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

What’s New in WCF 4.5?

Richard Blewett

Rock Solid Knowledge Ltd

DEV326

Page 3: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

Agenda

The big pictureSimplificationModern communication

Page 4: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 5: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

Simplification

Configuration simplificationContract firstFlat WSDLNew async model

Page 6: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

Configuration Simplification

WCF 4.0 simplified server configDefault endpointsDefault binding configDefault behaviors

WCF 4.5 simplfies client configAdd Service Reference only generates necessary config

Page 7: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 8: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 9: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 10: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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);}

Page 11: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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(); // ...}

Page 12: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

demo

WCF 4.5 Async Support

Page 13: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

Modern Communication

Metro ClientsUDPWebSocketsNetHttpBinding

Page 14: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 15: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 16: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

demo

UDP Broadcast

Page 17: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 18: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

demo

WebSockets to the Browser

Page 19: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

NetHttpBinding

Productionization of the NetHttpBinding SampleBasicHttpBinding with binary encoder

Supports HTTP based duplex over single connectionUses WebSockets for duplexRequires Windows 8 / Windows Server 2012

Page 20: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

demo

WebSockets to Metro Client

Page 21: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

And more …

Streaming enhancementsConfig intellisense and tooltipsConfig validationRevised quota defaultsMultiple authentication modes in IIS hosting

Page 22: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

Conclusion

.NET 4.5 makes WCF development easier

.NET 4.5 makes WCF development richer

Page 23: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

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

Page 24: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

Evaluations

http://europe.msteched.com/sessions

Submit your evals online

Page 25: What’s New in WCF 4.5? Richard Blewett Rock Solid Knowledge Ltd DEV326

© 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.