Download presentation
Presentation is loading. Please wait.
Published byBetty Lewis Modified over 8 years ago
1
Windows Communications Foundation ("Indigo"): Developing Manageable Web Services Alex Weinert COM308R Lead Program Manager Windows Communication Foundation Microsoft Corporation
2
2 About This Talk Manageability principles Built in WCF Management Features How you can make your WCF services more manageable
3
3 App Code App Code Energy And Entropy App Code Admin View Admin View Admin View End-user: values UNIQUENESS Administrator: values SIMILARITY User View User View User View Management features are a way to present a homogenous view of things in a heterogeneous environment App logic contributes to both user view and admin view.
4
4 TheHard/Long(useful)Part TheFun/ShortPart The Life And Times… HUMANConceptualizationConceptionBirthChildhood Teen Angst Productive Years The Golden Years SOFTWARE Design/Arch Development Deployment Configuration Troubleshooting Monitoring Reconfiguration
5
5 WCF What 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
6
(With the kind permission of St. Martin’s Press) Demo Scenario: Dan Brown’s Digital Fortress
7
7 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.
8
8 Digital Fortress Node 3 – User Interface NSA Data: Façade Service Data Bank: Storage Gauntlet: Virus Detection TRANSLTR: Decryption
9
WCF Management Features
10
10 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”
11
11 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?
12
12 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
13
13 Use The Configuration System! What goes in code Business logic Instancing, concurrency, autoenlist/complete What goes in config EndpointsBindingsBehaviorsClientsDiagnostics
14
14 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 void UpdateConfiguration(void);} public class MyService:MyContract, MyAdminContract { …}
15
Walkthrough Adding a Management Interface
16
16 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(){ public void DoSomething(){ TraceSource mySource = new TraceSource(“MyService”); TraceSource mySource = new TraceSource(“MyService”); mySource.TraceInformation(“I am doing something.”); mySource.TraceInformation(“I am doing something.”); }}
17
Walkthrough Adding custom traces
18
18 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( PerformanceCounterCategory.Create( "MyCategory", "MyDesc", "MyCategory", "MyDesc", PerformanceCounterCategoryType.MultiInstance, PerformanceCounterCategoryType.MultiInstance, "MyCounter", "MyCtrDesc"); "MyCounter", "MyCtrDesc"); PerformanceCounter counter = new PerformanceCounter( "MyCategory", "MyCounter", "InstanceName", false); "MyCategory", "MyCounter", "InstanceName", false);counter.Increment();
19
Walkthrough Adding counters
20
20 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(){ public myService(){ info = new AdminInfo(); info = new AdminInfo(); Instrumentation.Publish(info); Instrumentation.Publish(info); } protected AdminInfo info; } protected AdminInfo info; }
21
Walkthrough Creating a WMI object
22
22 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
23
Walkthrough Building Management UI
24
24 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
25
25 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/ http://msdn.microsoft.com/webservices/ Channel 9 tag: http://channel9.msdn.com/tags/Indigo Contact me: Alex.Weinert @ microsoft.com
26
Questions?
27
27 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); }
28
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.