You need to add this in your web.config
<system.net>
<defaultProxy>
<proxy bypassonlocal="False" usesystemdefault="True" proxyaddress="http://127.0.0.1:8888" />
</defaultProxy>
</system.net>
- then Start Fiddler on the WEBSERVER machine.
- Click Tools | Fiddler Options => Connections => adjust the port as 8888.(allow remote if you need that)
- Ok, then from file menu, capture the traffic.
That‘s all, but don‘t forget to remove the web.config lines after closing the fiddler, because if you don‘t it will make an error.
Reference : http://fiddler2.com/documentation/Configure-Fiddler/Tasks/UseFiddlerAsReverseProxy
http://
in proxy address. All the rest was the same, as you‘ve mentioned. – Johnny_D Aug 29 ‘13 at 12:26http://localhost/abc.svc
tohttp://HOSTNAME/abc.svc
– cateyes Aug 21 ‘14 at 1:31Consolidating the caveats mentioned in comments/answers for several use cases.
Mostly, see http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureDotNETApp
In a console app, you might not need to specify the
proxyaddress
:In a web application / something hosted in IIS, you need to add the
proxyaddress
:HttpWebRequest
, etc) it will always bypass the Fiddler proxy for URLs containinglocalhost
, so you must use an alias like the machine name or make up something in your ‘hosts‘ file (which is why something likelocalhost.fiddler
orhttp://HOSTNAME
works)If you specify the
proxyaddress
, you must remove it from your config if Fiddler isn‘t on, or any requests your app makes will throw an exception like:Standard WCF Tracing/Diagnostics
If for some reason you are unable to get Fiddler to work, or would rather log the requests another way, another option is to use the standard WCF tracing functionality. This will produce a file that has a nice viewer.
Docs
See https://docs.microsoft.com/en-us/dotnet/framework/wcf/samples/tracing-and-message-logging
Configuration
Add the following to your config, make sure
c:logs
exists, rebuild, and make requests: