Search code examples
asp.net-mvcfiddler

Use to Fiddler trace a third party webservice call in ASP.NET MVC action method


Using Fiddler I want to trace a call to an external webservice made 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 webservice from an ASP.MVC action method I can't see the underlying request to the external server, although I can see the request to the action method 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 show the request/response to a third party webservice made in the body of an ASP.NET MVC action method?


Solution

  • Moving the answer from comments to Answer section:

    Can you try setting Fiddler as a proxy, and use the Fiddler proxy when you call the webservice

    details about how to set it up at http://fiddler2.com/fiddler/help/hookup.asp