280 likes | 406 Views
Windows Communications Foundation ("Indigo"): Developing Manageable Web Services. Alex Weinert COM308 Lead Program Manager Windows Communication Foundation Microsoft Corporation. About This Talk. Manageability principles Built in WCF Management Features
E N D
Windows Communications Foundation ("Indigo"): Developing Manageable Web Services Alex Weinert COM308 Lead Program Manager Windows Communication Foundation Microsoft Corporation
About This Talk • Manageability principles • Built in WCF Management Features • How you can make your WCF services more manageable
Energy And Entropy Management features are a way to present a homogenous view of things in a heterogeneous environment User View App Code Admin View Administrator: values SIMILARITY End-user: values UNIQUENESS User View App Code Admin View User View App Code Admin View App logic contributes to both user view and admin view.
HUMAN Conceptualization Conception Birth Childhood Teen Angst Productive Years The Golden Years SOFTWARE Design/Arch Development Deployment Configuration Troubleshooting Monitoring Reconfiguration The Life And Times… The Fun/Short Part The Hard/Long (useful) Part
WCFWhat WE do for IT pros • Configuration system which allows post-deployment tuning and control of many aspects of service • Tracing sources provide traces for service internals, logged messages, activities • Performance counters for key operation, security, reliability, transaction statistics • WMI Provider allows scriptable query support for all aspects of running services • Windows Event Log helps with diagnosis of deployment problems • Configuration Editor and Trace Viewer in the SDK simplify common IT Pro tasks
Demo Scenario: Dan Brown’s Digital Fortress (With the kind permission of St. Martin’s Press)
Digital Fortress Cmdr. Strathmore administers TRANSLTR … a billion-$ govt. computer to decrypt any code. Then someone invents Digital Fortress: an encryption algorithm that can’t be broken. Strathmore conspires to hide his dilemma … But the IT Pros see something is wrong with TRANSLTR. So, the conspiracy is exposed by the management interfaces.
Node 3 – User Interface NSA Data: Façade Service Gauntlet: Virus Detection TRANSLTR: Decryption Data Bank: Storage Digital Fortress
Tools Cheat Sheet • You’ll find the tools in • “\Program Files\Microsoft SDKs\WinFX\bin” • Trace Viewer: SvcTraceViewer • Configuration Editor: SvcConfigEditor • You must override strong name validation to use the svcConfigEditor. • From a command prompt type: • “sn –Vr svcConfigEditor.exe”
The Challenge • We are putting basic instrumentation, control mechanisms, diagnostics “in the box” with WCF • Much of what you’ve had to code in the past is now done for you in the framework • You’ll get manageable Web Services with WCF even if you don’t code for manageability • You can raise the bar for manageability! • Now that you don’t need to write timer code to determine latency, throughput, error rates… • What can you do with that same investment?
What YOU Do For IT Pros • Management interfaces expose key insights and controls on your service • Traces assist diagnostics and supportability of your application • Counters measure what matters for your service • WMI objects provide scriptable query support for your management objects • UI presents an IT experience for your application
Use The Configuration System! • What goes in code • Business logic • Instancing, concurrency, autoenlist/complete • What goes in config • Endpoints • Bindings • Behaviors • Clients • Diagnostics
Adding A Management Service Interface • Why: Inspection, Control • What: IManageFoo – Management interface gives key data, control access into the app • How: Add another contract, make it a [ServiceContract] [ServiceContract] interface MyAdminContract{ public void UpdateConfiguration(void); } public class MyService:MyContract, MyAdminContract { … }
Adding Traces • Why: Diagnostics, Supportability. • What: Key milestones in processing, detailed data at different levels • How: Create a trace source, use it to emit traces. using System.Diagnostics; public class MyService:MyContract, MyAdminContract { public void DoSomething(){ TraceSource mySource = new TraceSource(“MyService”); mySource.TraceInformation(“I am doing something.”); } }
Adding Counters • Why: Monitoring, Trending • What: Key business level metrics, trends • How: Create a perf counter, create an instance with appropriate name, use it. • Hint: Consider instance lifetime when creating counters! using System.Diagnostics; PerformanceCounterCategory category = PerformanceCounterCategory.Create( "MyCategory", "MyDesc", PerformanceCounterCategoryType.MultiInstance, "MyCounter", "MyCtrDesc"); PerformanceCounter counter = new PerformanceCounter( "MyCategory", "MyCounter", "InstanceName", false); counter.Increment();
Adding WMI Objects • Why: Monitoring, Scripting • What: Internals of your app • How: Create a class, attribute it, instance it, register it using System.Management.Instrumentation; [InstrumentationClass(InstrumentationType.Instance)] public class AdminInfo {public string importantStuff;} public class myService:myInterface { public myService(){ info = new AdminInfo(); Instrumentation.Publish(info); } protected AdminInfo info;}
Building Management UI • Why: Dashboard for your app. • What: One stop shopping. • How: Use System.Diagnostics and Systems.Management client APIs • Hint: In Server, everything I’ve shown you from WMI is available via WS-Management
Summary • WCF Apps are manageable out of the box • Deployment flexibility • SLA monitoring • End to end diagnostics • You can make them even better • Create Management Endpoints • Add instrumentation • Build custom UI for admins
Community Resources • At PDC • For more information, go see • COM307 - Windows Communications Foundation ("Indigo"): Writing Reliable and Transacted Distributed Applications (Wed 3:15pm) • COM320 - IIS 7: Instrumenting, Diagnosing, and Debugging Web Applications (Thu 11:30am) • FUN316 - Windows Vista & "Longhorn" Server: Publishing and Consuming Events (Thu 2:15pm) • Labs: COMHOL25 – Management • Ask The Experts table: WCF • Product Pavilion: I’ll be there Thu 9:00am-12:00pm • COM Track lounge: I’ll be there Thu 12:30-3:30pm • After PDC • MSDN dev center: http://msdn.microsoft.com/webservices/ • Channel 9 tag: http://channel9.msdn.com/tags/Indigo • Contact me: Alex.Weinert@microsoft.com
Use the PDC Management Tool!!! namespace PDC { //Fill out your evaluation for a copy of Digital Fortress [ServiceContract(Session=true)] public interface IEvaluation { [OperationContract] DigitalFortressNovel Submit(Evaluation yourEvaluation); } }
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.