Catching local SOAP traffic with Fiddler

Fiddler is a great tool for testing and debugging web services. It logs and analyze all HTTP traffic between your machine and the Internet. I think it could be extremely beneficial to see how data is actually being serialized and what exactly is being sent to/from a web-service or application.

When it comes to catching a local traffic you have to do some tweaks, since .NET tries to avoid any proxies when it sends local requests. I had no problem catching local REST traffic by simply changing web-service address from http://localhost:[port]/… to http://ipv4.fiddler:[port]/… However when I tried to see a local SOAP traffic this simple address change did not bring any result and the SOAP messages were still not logged.

I had to spend some time and try multiple ways to fix this issue, starting from modifying a web.config to explicitly specify a proxy and ending with modifying a localhost value in /etc/hosts. Here are the steps that actually worked for me:

1. Modified client’s web-service address from “localhost” to “localhost. (I think it is better then changing it to the actual machine name (makes client configuration machine-dependent) and definitely better than ipv4.fiddler (cannot work without fiddler proxy turned on)).

2. Turned off listening on to the IPv6 adapter: Tools => Fiddler Options… => General tab => Enable IPv6 (if available) [uncheck]:image

These two steps allowed me to successfully see HTTP traffic to/from a web service hosted on a local ASP.NET development server (Cassini).