This is a migrated thread and some comments may be shown as answers.

Need to save all traffic from and to an IIS server....

5 Answers 510 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 25 Jul 2014, 10:40 PM
I need some advice on how to go about doing this.

I have an IIS server that has two asp mvc website applications (desktop and mobile). There is also a web service \ rest api that this website application exposes.
This web application also is a consumer of an external rest api.

As long as this iis server is running, I would like to capture all rest api requests\responses that are initiated by our web application to an outside rest api. The idea being that I would like to dump all these requests\responses somewhere(ideally as csv format so that I can import them into a database) and do some data analysis.

The data analysis is to
1. I want to make sure every rest api request has certain parameters (i.e not blank, 6 digits, etc...). 
2. make sure there is a 1 to 1 correspondence for a certain # of rows in a table in our application db with certain calls to the rest api.
etc....

I'm thinking of running fiddler as a service so that captures are always occurring using this reference (http://fiddler.wikidot.com/runasservice)
then use this reference (http://stackoverflow.com/questions/18066687/dumping-fiddler-sessions-automatically) to auto dump all web requests and responses into csv file. I can get by in c#.

Is there a better way to do what I want to achieve?






5 Answers, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 27 Jul 2014, 01:13 PM
Hello, Jungwoo Suh--

This should work in general, although you don't even need to run Fiddler as a service for this; it merely needs to run in SOME account on the machine in question and the IIS/ASP.NET proxy settings need to point at 127.0.0.1:8888. If the target resource is HTTPS, you need to ensure that Fiddler's root certificate is trusted machine-wide (MMC.exe > Certificates > Machine).

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
John
Top achievements
Rank 1
answered on 29 Jul 2014, 01:22 AM
Eric,

Thanks for the response.

I've gone ahead and added the proxy element stated in your book, for both machine.config files in the 32bit/v4 and 64bit/v4 folders. 

<system.net>
<defaultProxy> 
          <proxy 
            usesystemdefault="true" 
            bypassonlocal="false" 
            proxyaddress="http://127.0.0.1:8888" 
          /> 
        </defaultProxy> 

And according to the application pool, I'm definitely running v4 of the .net framework. After IISreset, turned on Fiddler, but I'm unable to see the rest api requests. I've checked both ipv4.fiddler:8888 and localhost:8888 and they both echo from fiddler.

and on the server, requests from IE do capture. 

Any ideas as to why the rest api requests aresn't showing?


Also, the reason I wanted fiddler to run as a service is because the server does get rebooted by others and I want to make sure every instance of an api request is being captured. Aside from startup task or service, is there a way to configure fiddler to always run in the background?


0
John
Top achievements
Rank 1
answered on 29 Jul 2014, 01:25 AM
although not shown  above, my machine.config does have a closing </system.net> 
0
Eric Lawrence
Telerik team
answered on 29 Jul 2014, 04:13 PM
Hello, Jungwoo--

You should have usesystemdefault="false" in the config files.

For the scenario you describe, running as a service is probably the best approach, but Fiddler is not tested in this configuration. Typically, developers instead use FiddlerCore to build a service-specific application for this task, but if Fiddler alone is doing what you need, that's nice to hear.

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
John
Top achievements
Rank 1
answered on 29 Jul 2014, 06:24 PM
For anyone else who is interested, I got this to work by making the changes in web.config file too. Not sure why the machine.config changes didn't cascade down to web.config.
Tags
Fiddler Classic
Asked by
John
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
John
Top achievements
Rank 1
Share this question
or