Usage for Fiddler tracks a third-party webservice call in an ASP.NET MVC action method

With Fiddler, I want to track the call to an external web service created in the body of an ASP.NET MVC action method.

When I run this code as a console application or Nunit test, I can see the request / response to the external server using Fiddler;

[Test] public void TestWebservice() { MyWebService checker = new MyWebService(); i = checker.GetAge("bob"); Assert.True(i >= 0); } 

When I call the web service from the ASP.MVC action method, I do not see the main request to the external server, although I can see the action method request from my browser;

 public ActionResult MakeTheCall(string name) { MyWebService checker = new MyWebService(); i = checker.GetAge(name); return View(); } 

Is there a way for Fiddler to display a request / response to a third-party web service created in the body of the ASP.NET MVC action method?

+2
source share
3 answers

Move response from comments to response section:

Can you try installing Fiddler as a proxy server and use the Fiddler proxy when calling webservice

details on how to configure it at http://fiddler2.com/fiddler/help/hookup.asp

+2
source

You can configure Fiddler as a reverse proxy server and redirect local calls to this port to a remote server on another port. Thus, you configure the application to call localhost: 8888 and Fiddler to meet the remote: 80.

http://www.fiddler2.com/fiddler/help/reverseproxy.asp

Another option is Charles, which has an easier configuration for this setup.

http://www.charlesproxy.com/

+1
source

I liked the phuzis answer WebRequest.DefaultWebProxy = new WebProxy ("127.0.0.1", 8888);

0
source

Source: https://habr.com/ru/post/954241/


All Articles