Label Cloud

Friday, March 30, 2007

Analyzing local webservices using Fiddler

Fiddler is a great tool for analyzing web traffic. it can be used to monitor, review and profile web sites as well as web services. The current realease version is great, but the version 2 Alpha is even better, since it allows interseption of HTTPS traffic.

I've used fiddler to profile our development and production website. It is also a great tool to monitor webserivce traffic. It will be able to show full incoming and outgoing message payloads. However, when debugging against localhost, Fiddler will not be able to intercept the traffic. There is a simple change that is required to be able to debug against localhost. Full description is at http://www.fiddlertool.com/Fiddler/help/hookup.asp - Section "Why don't I see IE7 or System.NET traffic sent to http://localhost or http://127.0.0.1?"

Here are the steps I used to be able to monitor smartclient application running against localhost (my development webserver is running on port 1652):

  • Start Fiddler v2
  • Select Rules -> Customize Rules...

  • Scroll down to OnBeforeRequest and add the override code if (oSession.host.ToUpper() == "SMARTAPP") { oSession.host = "127.0.0.1:1652" }

  • Point your application to SMARTAPP instead of pointing it to localhost:1652

That's all. Worked like a charm.


Share/Save/Bookmark

2 comments:

Unknown said...

Great tip, thanks a lot.

Anonymous said...

You might want to check out another tool by Nikhil Kothari which also captures https :
http://projects.nikhilk.net/Projects/WebDevHelper.aspx

it is particularly suited for asp.net development

Directory of Computers/Tech Blogs