Geeks With Blogs
Chris Falter .NET Design and Best Practices

Recently I discovered a tool that I had needed for a long time.  Fiddler, a freeware product created and supported by Microsoftie Eric Lawson, can be used to debug HTTP traffic from any web browser (or client application).  Here's how you can use it:

1. View/Analyze HTTP traffic. 

One of our web apps creates a new window and performs a javascript-driven auto-logon to a vendor application.  When we reported an issue to the vendor, they started asking questions about whether we were using the correct version of their javascript module.  Rather than attempting to debug the javascript, I simply used Fiddler to capture all the HTTP traffic between my browser and the vendor's web server.  Fiddler formatted the data quite nicely, which made verifying my browser's behavior quite simple.  Fiddler was also able to save the relevant portions of the HTTP conversation to a log file, which I forwarded to the vendor.  The vendor was able to determine quickly that the error was in the behavior of their web server, rather than in any incorrect use of javascript on our part. 

Just one day later, another vendor questioned whether one of our web services was correctly returning error data.  Source code-level debugging in the web service would have done me no good, since I had to verify the data being transmitted on the wire.  But Fiddler made the investigation easy.  I used Fiddler to capture an interaction between a test client and the service, and quickly verified that our service was returning the correct error data. 

You can also use Fiddler to view all the details of a secure HTTP interaction.  Try doing that with netmon!  Just configure Fiddler to view HTTPS traffic, and it will hook any secure HTTP transactions.  It uses the "man-in-the-middle" strategy: it sets up a secure HTTP transaction between the browser and itself, then transmits the data it receives to the target URL over secure HTTP.  Sitting in the middle, it is able to view all the data in the browser-server conversation.  You just have to tell your browser to ignore the any certificate errors associated with the temporary certificate that Fiddler generates.

2. Generate test scripts.

The Visual Studio 2005 Test Edition has a tool that allow you to generate a test script for a web app by capturing the interaction between a browser and a web app.  However, this tool only captures interactions (such as form submits) generated by clicking on links and buttons.  So how do you capture javascript-driven AJAX interactions?  Use Fiddler!

3. Analyze performance enhancements.

If you are trying to figure out how various browser settings will affect a website's performance, Fiddler can help.  You can script Fiddler to intercept browser interactions and alter metadata, which allows you to perform a "what if" analysis on the fly.  And Fiddler has a built-in timer to measure wall clock time during the interaction. 

The Fiddler site has extensive documentation, including some good QuickStart videos.  If you've been looking for a good tool to analyze HTTP traffic, look no more; go directly to the Fiddler download page and get started!

Posted on Monday, January 28, 2008 7:20 AM Performance & Tuning , Testing & Debugging , SOA | Back to top


Comments on this post: A Tool for Troubleshooting Web Apps and Web Services

# re: A Tool for Troubleshooting Web Apps and Web Services
Requesting Gravatar...
Thank you so much for this post - I've been looking for this for a while.
Left by Martin on Aug 20, 2008 3:22 AM

Your comment:
 (will show your gravatar)


Copyright © Chris Falter | Powered by: GeeksWithBlogs.net