A Deep Dive into Best Practices with the Windows Communication Foundation John Justice COM415 Program Manager Microsoft Corporation.

Slides:



Advertisements
Similar presentations
3/25/2017 8:53 AM Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer Kenny Wolf, Software Development Engineer.
Advertisements

Connected Health Framework
Indigo Jonathan Turnbull Nick Cartwright Ivan Konontsev Chris Bright.
.NET 3.5 SP1 New features Enhancements Visual Studio 2008 SP1 New features Enhancements Additional features/enhancements.
WCF Intro Scott Reed Owner - Brain Hz Software Instructor – DevelopMentor
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Windows Communication Foundation and Web Services.
Darryl Burling Developer Evangelist Microsoft The age of connected applications Whats new in VS2008 WCF Background: WS*,.Net 3.0 and WCF ABC’s & improvments.
The Microsoft Technical Roadshow 2006 Windows Communication Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
Getting Started with Windows Communication Foundation 4.5 Ed Jones, MCT, MCPD, MCTS Consultant RBA Inc.
Rob Williams Program Manager Microsoft Corporation.
Getting Started with WCF Windows Communication Foundation 4.0 Development Chapter 1.
Future Directions for Leveraging Advanced XML Tools and Building Custom XML Solutions Denise Draper DAT321 Microsoft Corporation.
Case Study: Revolutionizing Microsoft Axapta Mike Ehrenberg COML01 Architect, Microsoft Business Solutions Microsoft Corporation.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.
CON 307 Developing Manageable WCF Services Chris Peiris | Avanade Rory Primrose | Avanade
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
Future Directions: Building Customizable Applications using.NET Eric Schnepp TLN205 Lead Program Manager Microsoft Corporation.
1 Windows Communication Foundation: Integrating COM+ and MSMQ Applications Andy Milligan COM305 Program Manager Microsoft Corporation.
1 IIS and Windows Communication Foundation: Hosting Services Steve Maine COM 413 Program Manager Microsoft Corporation
WEB 304 An Overview of ASP.NET and Windows Workflow Foundation Kashif Alam Program Manager Developer Division Microsoft Corporation.
1 Windows Presentation Foundation ("Avalon"): Using Application Services Lauren Lavoie PRS314 Program Manager Microsoft Corporation
1 “Indigo”: Services And The Future Of Distributed Applications Don Box Architect Microsoft Corporation here –
Intro to WCF From the beginning and uses Steve AppRochester.
Web 310 XML Schema : What You Need to Know and Why Yasser Shohoud Program Manager XML Messaging Microsoft Corporation.
Developing Web Services Using ASP.NET and WSE That Interoperate with the Windows Communications Foundation ("Indigo") Mark Fussell COM432 Lead Program.
.NET Enterprise Services COM+ 1.5 麥超俊 Bobby Mak 架構技術推廣經理開發工具暨平台推廣處台灣微軟股份有限公司.
Mahesh Krishnan, Senior Consultant, Readify Slide 1.
Windows Communications Foundation ("Indigo"): Developing Manageable Web Services Alex Weinert COM308R Lead Program Manager Windows Communication Foundation.
“ WinFS” Future Directions: Building Data-Centric Applications Using Windows Presentation Foundation “Avalon” and Windows Forms Ramesh Nagarajan DAT310.
COM326: Web Services for XML Programmers Doug Purdy Lead Program Manager Connected Systems Division.
2 Productive Windows Communication Foundation Jeremy Boyd Mindscape MSDN Regional Director – New Zealand SOA315.
Lap Around Windows Presentation Foundation Rob Relyea PRS305 Lead Program Manager Windows Presentation Foundation
Windows Communication Foundation (“Indigo”): Writing Reliable and Transacted Distributed Applications Shy “BAD-P” Cohen COM307 Program Manager Connected.
Windows Communication Foundation David Anderson Independent Software Developer DCOM Productions.
Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
EBIZ302 Jupiter Business Process Automation and Web Services David Fong Program Manager.
Dhananjay Kumar MVP-Connected System 1. WCF  Agenda What is WCF ? Why WCF? Address, Binding, Contract End Points Hosting Message Patterns Programming.
Introduction to.NET FX 3.0 (+ sneak preview of.NET FX 3.5) Martin Parry Developer & Platform Group Microsoft Ltd
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
Windows Communications Foundation ("Indigo"): Writing Secure Distributed Applications Martin Gudgin COM312 Program Manager Microsoft Corporation.
Shani Raba Team Leader & Software Architect
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
Windows Communication Foundation Stipe Ivan Latković.
Nati Dobkin
Windows Communication Foundation and Web Services
Mike Harsh PRSL001 Program Manager Microsoft Corporation
Windows Communication Foundation
Segments Introduction: slides 2–7 10 minutes
4/12/2018 2:37 PM Windows Communication Foundation: Migration, interop, upgrade, and integration Risman Adnan ISV Lead, Microsoft Indonesia
Windows Communication Foundation
Windows Communication Foundation
Window Communication Foundation
Windows Communication Foundation (WCF)
Windows Communication Foundation and Web Services
Windows Communication Foundation
WCF (Indigo): Under the Hood of the Channel Layer
Implementing RESTful Services Using the Microsoft .NET Framework
Building real-time web apps with HTML5 WebSockets
Building a great Metro style device app for your camera
Modeling & Messaging for Connected Systems
Building event-driven, long-running apps with Windows workflow
Tech Ed North America /1/ :36 AM Required Slide
TechEd /3/ :48 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Distributed Applications on Windows Vista
User Segmentation and Targeted Push Notifications for UWP apps
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
Windows Forms in Visual Studio 2005: An in-depth look at key features
Presentation transcript:

A Deep Dive into Best Practices with the Windows Communication Foundation John Justice COM415 Program Manager Microsoft Corporation

What we’re covering today: 10 – Choose a Binding that Fits Your Needs 6 – Stay Flexible with Config 6 – Stay Flexible with Config 5 – Send Faults, not Exceptions 5 – Send Faults, not Exceptions 4 – Avoid UI Threading Conflicts 4 – Avoid UI Threading Conflicts 3 – Use UDDI Internally 3 – Use UDDI Internally 2 – Go Beyond XML Interoperability 2 – Go Beyond XML Interoperability 1 – Understand the Service Lifecycle 1 – Understand the Service Lifecycle

10: Choose a Binding that Fits Your Needs

BasicHttpBindingWsHttpBindingWsDualHttpBinding Bindings: Out of the Box NetTcpBindingNetNamedPipeBindingNetMsmqBindingNetPeerTcpBinding Interoperable WCF to WCF

Bindings: Decision Tree BasicHttpBinding WsHttpBinding Interop? What Level? Duplex? WSDualHttpBinding NetNamedPipeBinding NetMsmqBinding NetPeerTcpBinding NetTcpBinding No Basi c No Yes Local? Need Queues? Peer to Peer? No No No Yes Yes Yes WS Yes

Bindings

6: Stay Flexible with Config

Config: Range of options Deployment Flexibility All Code All Config End-user apps Enterprise apps

Config: When you need to lock down… Lock down only what you must Check your requirements Make sure your checks are being executed Write a custom ValidatorWrite a custom Validator Create your own BindingCreate your own Binding Require your Validator with in machine.configRequire your Validator with in machine.config Use a custom ServiceHostUse a custom ServiceHost Note: A malicious programmer can circumvent any of these options in code.

Stay Flexible with Config

5: Send Faults, not Exceptions

Send Faults, Not Exceptions Faults are at the contract level Don’t shove implementation level exceptions into your Faults When you get into trouble, send business level faults, not exceptions Indigo makes defining and sending custom faults easy

Custom Faults

4: Avoid UI Threading Conflicts

Avoid UI Threading Conflicts Windows Forms and Windows Presentation Foundation apps use the main program thread for updates WCF services use the main program thread for processing requests If you host a WCF service (or duplex client) in a Windows Forms or WPF app, you’ll need to be careful

Windows Forms Threading

3: Use UDDI Internally

Use UDDI Internally UDDI isn’t just for public registries When you need a layer of Web service indirection, think UDDI Development -> Test -> Staging -> Production Choosing between non-clustered services

UDDI

2: Go beyond XML Interoperability

Interop: Send Useful XML Infrastructure interoperability: == The plumbing can deliver your XML Being kind to your consumers: == There’s a good programming experience on both sides of the wire Use a practical, platform neutral subset of XML Schema Follow solid engineering practices when designing your contracts

Interop: Contract Guidelines Use our work: prototype with DataContract Use simple types that map well between.NET and Java DataSet is great for.NET to.NET, but isn’t supported well by other vendors Use typed, self-contained complex types When writing XSD-first: Avoid Avoid

1: Understand the Service Lifecycle

Service Lifecycle: Primary players Channel Lives for lifetime of channel sessionLives for lifetime of channel session Holds security informationHolds security information Holds Reliable Session IDHolds Reliable Session ID InstanceContext Provides connection between Channel and Service objectProvides connection between Channel and Service object Controls instance sharing and lifetimeControls instance sharing and lifetime Service Your object that implements the contractYour object that implements the contract

Service Lifecycle: Channel session Channel Lifetime: Lives for the duration of the channel sessionLifetime: Lives for the duration of the channel session Channel lifetime varies by transportChannel lifetime varies by transport InstanceContextService What’s the session lifetime of my channel? HTTP  One Operation TCP  Connection MSMQ  One Operation Turn on Reliable Sessions to extend the session lifetime

Service Lifecycle: Channel session Channel Turn on Reliable Sessions to extend the session lifetime InstanceContextService </binding> </bindings>

Service Lifecycle: Channel session Channel Get finer-grained control with IsInitiating() and IsTerminating InstanceContextService // Close the Channel after calling [OperationContract(IsTerminating=true)] public String Echo(String input);

Service Lifecycle: Instancing Channel Q: How is my InstanceContext related to my Channel? A: InstanceMode InstanceContextService Provides connection between Channel and Service objectProvides connection between Channel and Service object Controls instance sharing and lifetimeControls instance sharing and lifetime

Service Lifecycle: Instancing ChannelInstanceContextService Instance Modes: PerCall (Default)PerCall (Default) PrivateSessionPrivateSession SharedSessionSharedSession SingletonSingleton ServiceBehavior(InstanceMode=Ins tanceMode.PerSession)] public class MyService : IMyService {…}

Service Lifecycle Instancing decision tree NeedState? Use Per Call – New context every call Use Singleton – One context for everyone Use Shared Session – Same as private session, but can share contexts within a group Use Private Session – One context per client StateScope? Shared? Yes Yes Grouped No No Global

Service Lifecycle: Service type ChannelInstanceContextService [OperationBehavior( ReleaseInstance=ReleaseInstance Mode.BeforeAndAfterCall)] public String Echo(String input) {…} By default, Service type lifetime is connected to InstanceContext Override this connection with ReleaseInstanceOverride this connection with ReleaseInstance BeforeCallBeforeCall AfterCallAfterCall BeforeAndAfterCal lBeforeAndAfterCal l

Community Resources At PDC For more information, go see COM423: WCF: Web Services Interoperability with Java/J2EE (Thurs 2:15pm) COM424: WCF: Extending the Channel Layer (Thurs 3:45pm) COM326: WCF: Web Services for XML Programmers (Thurs: 5:15pm) COM429: WCF: Extending the Service Model Layer (Fri: 10:30pm) Labs: COMHOL22, COMHOL28, COMHOL29 Ask The Experts table: General WCF (Thursday night) COM Track lounge After PDC If you missed this related session, watch it on the DVD COM416: WCF: Under the Hood of the WCF Channel Layer COM417: WCF: Under the Hood of the Service Model Layer MSDN dev center: Channel 9 tag:

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.