WSE Tracing Tools

Debug Your WSE-enabled Web Services Using Two Convenient Methods

Ken McNamee

October 30, 2009

5 Min Read
ITPro Today logo

ToolKit

LANGUAGES: ALL

ASP.NETVERSIONS: ALL

WSE Tracing Tools

Debug Your WSE-enabled Web Services Using Two ConvenientMethods

 

By Ken McNamee

 

Web services are becoming increasingly utilized as the de facto standard for inter-Web site,inter-server, and inter-business communication. At my day job I rarely comeacross a project these days that doesn t use Web services to some degree. Toget the most out of these Web services, I always use Microsoft s add-on for the.NET Framework: Web Services Enhancements (WSE). Now at version 2.0, WSEprovides developers with ever-increasing functionality and the ability toexpose complex, yet secure and reliable, Web services that adhere to the mostup-to-date cross-platform standards like WS-Security, WS-Policy, and manyothers.

 

However, the problem with Web services is that they can bea little difficult to debug. One of the best debugging methods currently in useis to trace the SOAP request and SOAP response to see exactly what data isgetting passed across the wire. A little more than a year ago, I introduced youto the MicrosoftSOAP Trace Tool in the SOAP Toolkit. Although that tool can still be usedwith WSE-enabled Web services, it is not really optimized for it and hasdefinitely become dated. So in this article I m going to introduce you to acouple of new, free tools that perform WSE tracing in very different ways.

 

Simon Guest s WSE 2.0 Trace Tool

The first tool in this article is definitely the simplerof the two. In fact, simplicity is the main goal that Simon Guest was trying toachieve and this is its biggest selling point. This tool depends completelyon the tracing feature inherent in WSE. Simply add the configuration code fromFigure 1 into your web.config file and the contents of every SOAP request andresponse will be saved into the input and output files. To be honest, it sprobably a misnomer to even call this a tracing tool because it doesn tactually perform any tracing itself. It s more of a WSE trace file viewer.

 

 

                             output="OutputTrace.webinfo" />   Figure 1: This configurationtext in the web.config file instructs ASP.NET to save all the information aboutevery SOAP request and response to the input and output files.   What makes this tool so darn useful is that it is simply asingle executable file that needs no installation. You can simply drop it on aserver, point it at the location of the WSE trace files, and get aneasy-to-read display of all the SOAP calls in the viewer panes, as displayed inFigure 2.  
Figure 2: Simon Guest s WSE Tracetool is a very simple application that provides a significantly easier-to-readinterface for viewing the WSE trace files and diagnosing problems.   However, this is not a perfect tool by any means. The tooldoesn t display incoming SOAP calls in real time, and I find that I need toclick between the tabs to make it refresh itself. Also, although the WSE tracefiles are very useful, it appears that ASP.NET puts a filesystem lock on thesefiles and it becomes necessary to restart the worker process to turn thetracing off. That being said, if you need a better trace file viewer thanNotepad, this is the one to use.  Mike Taulty s WSE 2.0 Tracing Utility Unlike the Simon Guest tool, Mike Taulty s tracing tool isnot only a file viewer, but a real-time WSE tracing application. It works bytelling WSE to send a copy of all SOAP calls to a port on which the tool islistening. It s actually pretty ingenious. As SOAP requests come in to the Web services,and SOAP responses go out, the details of each call are displayed in real timein the tool, as you can see in Figure 3.  
Figure 3: Mike Taulty s WSE tracing utilityis an excellent real-time tracing tool that works best for development.   I don t profess to know exactly how this tool does itsthing. As best as I can tell, it installs a SOAP filter into the GAC. You mustthen add the information in Figure 4 to the web.config file, which inserts thefilter into the SOAP pipeline. As each SOAP request and response is processed,a copy of the SOAP envelope is sent to the Mike Taulty tool. As you can see,simplicity is not one of its advantages, but it is very, very good at real-timeWSE SOAP tracing.                            Version=1.3.0.0, Culture=Neutral,                PublicKeyToken=b9178bf39dc4a013"/>                           Version=1.3.0.0, Culture=Neutral,                PublicKeyToken=b9178bf39dc4a013"/>       Figure 4: Thisconfiguration text in the web.config file tells the SOAP pipeline to send acopy of each request and response to the Mike Taulty tracing tool in real time.  Conclusion Which tool is better for tracing WSE calls? Well, thatdepends. The information they display is exactly the same. I find that I usethem both, but for different reasons. The Simon Guest tool I use when trying todiagnose problems on a development, test, or even production server. If aclient is having a Web services issue we might turn on tracing for a period oftime and then use this tool to see exactly what was being passed back andforth. I find that this tool works very well in this diagnostic capacity.However, because it lacks a real-time mode, it doesn t work as well fordevelopment.   The Mike Taulty tool is the inverse of the Simon Guesttool. Because of its need to be installed and remain running while tracingcalls, and its lack of a save feature, it doesn t work as well for diagnosingissues on a remote server. However, I find that it is excellent for tracing mySOAP calls on my development machine as I m developing. Everything is displayedin real time and I can see exactly how my code was translated into SOAP. So,each tool has its place in my toolbox and I suspect that they can find aplace in yours, as well.  References Simon Guest s WSE 2.0 Trace Tool http://blogs.msdn.com/smguest/archive/2004/08/19/217394.aspx   Mike Taulty s WSE 2.0 Tracing Utility http://mtaulty.com/blog/archive/2004/05/25/433.aspx  Ken McNamee is aSenior Software Developer with Vertigo Software, Inc., a leading provider ofsoftware development and consulting services on the Microsoft platform. Priorto this, he led a team of developers in re-architecting the Home ShoppingNetwork s e-commerce site, http://www.HSN.com,to 100% ASP.NET with C#. Readers can contact him at [email protected].      

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like