How to capture ASP.NET web service traffic using Fiddler

  • Description

    Sometimes, for troubleshooting purposes it is necessary to use HTTP debugging proxies to capture and investigate HTTP traffic of your web site.

    A good example of such a proxy is Fiddler. For more information about Fiddler visit the following page:
    http://www.telerik.com/fiddler

    When running Fiddler, it changes proxy server settings for the currently logged in Windows user to allow capturing traffic from web browsers or other applications. Specifically, it changes the system's proxy settings to the 127.0.0.1:8888 address.

    However, this does not affect applications such ASP.NET sites, as they use different user account and own proxy settings.

    This article describes how to configure an ASP.NET web site to use Fiddler as a proxy, and to allow Fiddler capture web service calls between the ASP.NET web site and web services the site is using.

  • To configure the Fiddler tool to capture web service calls from an ASP.NET web site, you need to perform the following actions on your solution:

    1. In the Global.asax file, implement the following Application_Start method:
      <script runat="server">
          public void Application_Start()
          {
              ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
          }
      </script>
    2. In the Global.asax file, add the following import statements:
      <%@ Import Namespace="System.Net" %>
      <%@ Import Namespace="System.Net.Security" %>
    3. In the web.config file, configure the following XML under the <configuration> section:
      <system.net>
        <defaultProxy useDefaultCredentials="true" enabled="true">
          <proxy usesystemdefault="false" proxyaddress="http://127.0.0.1:8888" bypassonlocal="false" autoDetect="false"/>
        </defaultProxy>
      </system.net>
    4. Enable Fiddler to capture the HTTPS traffic.

    After the traffic is captured by Fiddler, it can be saved for further sharing and analysis.

Applies to:

EXM 1.0+, App Center 1+, CMS 6+

October 08, 2014
October 08, 2014

Keywords: 

  • App Center
  • ,
  • CMS
  • ,
  • ECM