Capturing Traffic from .NET Services with Fiddler 12 Comments Tuesday, January 08, 2013 by Fiddler When Fiddler launches and attaches, it adjusts the current user’s proxy settings to point at Fiddler, running on 127.0.0.1:8888 by default. That means that traffic from most applications automatically flows through Fiddler without any additional configuration steps. However, sometimes you might want to capture traffic running in a different user account – for instance, you may want to capture web service calls from an ASP.NET page to a web service running on a different machine, or you might want to debug the traffic from a Test Studio Load Test agent, which runs under a service account. Fortunately, if you’re an administrator, it’s pretty easy to get .NET Services to point at Fiddler. Simply open the machine.config file and add a new defaultProxy setting that points at Fiddler: 1. Start Fiddler. 2. Launch Notepad elevated (as an Administrator). 3. Open machine.config in the folder C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config. Note that if you are debugging a 64bit service (like ASP.NET) you will want to look in the Framework64 folder instead of the Framework folder. Similarly, if you are using a .NET version prior to 4.0, you will need to adjust the version part of the path. 4. Add the following XML block as a peer to the existing system.net element, replacing any existing defaultProxy element if present: <!-- The following section is to force use of Fiddler for all applications, including those running in service accounts --> <system.net> <defaultProxy enabled = "true" useDefaultCredentials = "true"> <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" /> </defaultProxy> </system.net> It should look like this: 5. Save the file. 6. Restart the services. Most services are restarted using the Services MMC applet, but for Test Studio, you can use the Start/Stop buttons in the Test Studio UI: After this configuration change is made, traffic from services should begin to flow through Fiddler: When you’re done debugging, be sure to revert your changes to machine.config and restart the services. If you forget to undo your changes, you’re likely to find that all of your services can no longer reach the network the moment that Fiddler is shutdown. LinkedInMailTo Tags: howto Read more articles by Fiddler - or - read latest articles in Developer Tools About the author Eric Lawrence Eric Lawrence (@ericlaw) has built websites and web client software since the mid-1990s. After over a decade of working on the web for Microsoft, Eric joined Telerik in October 2012 to enhance the Fiddler Web Debugger on a full-time basis. With his recent move to Austin, Texas, Eric has now lived in the American South, North, West, and East. 12 Comments Hello Eric, Great Article! I was having some trouble with configuring fiddler to debug a WCF REST web service I made. My WCF REST service performs some basic GET and POST to retrieve and insert data into the database.Its hosted on IIS 7.5 so I use Localhost. I was able to debug GET by using the debugger provided by Visual Studio 2012.But to debug POST I needed a software which could make a REQUEST and invoke the service as I dont have an application(client) to do so nor a debugger to debug the POST method implemented under the service. So I found an article http://www.codeproject.com/Tips/213007/Debug-WCF-REST-Service which uses fiddler to invoke the web service and then debug the POST method. I followed the steps to attach the process after composing the POST request in fiddler.And I click execute too but it doesn't switch back to the VS 2012 screen ,where I have set the breakpoint ,as it should to start debugging.Instead it just stays on the fiddler screen and shows 404 error on the left side of the fiddler split screen.And on the right side under WebView in the Response section It says: SERVICE Endpoint not found (but that error is probably because there is something not right with my POST method) I also took a look under the Modules section(Debug->Windows->Modules) at the Symbol Load Information for Fiddler in VS while debugging and it says that it Cannot find Fiddler.pdb. Is that the reason why I was unable to debug? And I didn't implement the steps at the start of the article whose link i provided.Do I need Microsoft.Servicemodel.Web.dll to use Fiddler? Can you please help me with my problem as it has been a few days and I'm unable to find anything useful on Google. Thank You. Hi, Jot! No, the Fiddler.pdb and ServiceModel.web.dll files aren't relevant here-- those only matter if you were trying to debug Fiddler or use the WebService APIs inside Fiddler. But instead what you're doing is using Fiddler to send HTTP traffic to your service, and your service takes over from there. The problem you're having is that your traffic isn't making it to the web service because IIS isn't routing it the way that it needs to; that typically means that the HOST header in the request isn't correct, or possibly that the URL path isn't quite right. Your best bet for questions like these is to post them to the Fiddler discussion group (see http://fiddler2.com/r/?fiddlerdisc ) or on StackOverflow.com. I have done with same action on same browser for one application on two different PCs and observed no of request sent in Fiddler. Here request are different on two different PCs. Can you help me out here to know why no of requests are different? Eric, I am attempting to use Fiddler2 to intercept SOAP messages from my application to a web service (FedEx). This article (http://blogs.telerik.com/fiddler/posts/13-01-08/capturing-traffic-from-.net-services-with-fiddler) says to edit the machine.config file. However, my machine.config is not formatted like this. This format does suit the web.config file but changing the defaultProxy settings there had no effect. The machine.config is formatted more like: <sectionGroup name = "system.net" .... <section name = "defaultProxy" type = "System.Net.Configuration.DefaultProxySection... Can you guide me on editing this file to get my SOAP messages to show in Fiddler2? @Mel: You need to edit the file named exactly "machine.config" and you need to follow step #4 exactly. You're looking at the wrong place in the file; you need to ADD a block. You may want to clarify that people need to create a new system.net element. Stock machine.config files do not have this. @Eric, my machine.config has different xml structure. <sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="authenticationModules" type="System.Net.Configuration.AuthenticationModulesSection, System, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="connectionManagement" type="System.Net.Configuration.ConnectionManagementSection, System, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="defaultProxy" type="System.Net.Configuration.DefaultProxySection, System, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <sectionGroup name="mailSettings" type="System.Net.Configuration.MailSettingsSectionGroup, System, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="smtp" type="System.Net.Configuration.SmtpSection, System, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectionGroup> <section name="requestCaching" type="System.Net.Configuration.RequestCachingSection, System, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="settings" type="System.Net.Configuration.SettingsSection, System, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="webRequestModules" type="System.Net.Configuration.WebRequestModulesSection, System, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectionGroup> please give xml to be added for this config. The config mentioned by you does not work here. How do we capture Fiddler traces on the server side instead from the client. Also how do we get it working for https traffic on server side A quick question: http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx says "If the defaultProxy element is empty, the proxy settings from Internet Explorer will be used". So can one not get away with just - <system.net> <defaultProxy /> </system.net> [EricLaw] No, typically that won't work. Internet Explorer proxy settings are generally per-user, and services typically run in a different user account. Please note: if you're wishing to debug a single .Net service, you can add the < system.net> described above to the configuration file for the specific program rather than the whole machine. I get some trouble in using fiddle tool there is a c/s project, some RESTful api are writen in java, and they are host in localhost client is wpf platform ,in client ,I access the api for data, but i can't capture any information with fidder but why? if I want to fetch http request information with fidder,how to do that ? thank you Fiddler not capturing HTTP traffic from a WPF application I have a WPF application that makes a lot of HTTP request calls to other servers. Some of these requests are failing so I'm trying to use Fiddler to capture the traffic so I can diagnose the issues. However, when I run Fiddler I do not see any of the traffic from my WPF application. I do see traffic when I use a browser and type in some URL. Do I have something configured incorrectly or is Fiddler not able to be used in this scenario? I install fiddler in defaut settings ,and nerver change any thing . but fiddler can not caputure any information, You are not allowed to post comments.