.NET: HowTo enable WebService calls to be sent through Fiddler

Assuming you in Web.config have:

      <proxy autoDetect="True" />

Then in your transform file you change it with

      <!-- Enable webservice calls to be sent through Fiddler  http://docs.telerik.com/fiddler/configure-fiddler/tasks/configuredotnetapp -->
      <proxy bypassonlocal="False" usesystemdefault="True" xdt:Transform="SetAttributes"/>
      <proxy xdt:Transform="RemoveAttributes(autoDetect)" />

On the page, where you have a web service call you need to accept the Fiddler certificate, but only in your Debug mode:

        protected async void Page_Load(object sender, EventArgs e)
            //Fix for accepting Fiddler cert: The remote certificate is invalid according to the validation procedure.
            ServicePointManager.ServerCertificateValidationCallback += (o, c, ch, er) => true;

The End.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: