Web API methods not getting profile data
rzieroth
Posts: 4
I have a Web API method which I am trying to profile. When I make the call to the web api I can see the profiler track the construction of the controller but the api method is not getting any profile data captured.
[ResponseType(typeof(ResponseMessage))]
public IHttpActionResult Post(RequestMessage inRequest)
{
var engine = EngineFactory.GetMyEngine(inRequest);
var aResult = engine.GetRecommendations(inRequest, RequestContext);
return Ok<ResponseMessage>(recommendationResult);
}
Any ideas on what is going on?
[ResponseType(typeof(ResponseMessage))]
public IHttpActionResult Post(RequestMessage inRequest)
{
var engine = EngineFactory.GetMyEngine(inRequest);
var aResult = engine.GetRecommendations(inRequest, RequestContext);
return Ok<ResponseMessage>(recommendationResult);
}
Any ideas on what is going on?
Comments
Is it because the application you are profiling is the consumer of the webservice, and the web methods are running in a WCF service hosted in a webserver? In that case, you can profile the webservice to see these results.
I have a Web API Controller with 4 methods. The first two
Post(int id) and Get(int id) get profile data.
The next two do not get profile data.
Get(MyObject inputObject)
Post(MyObject inputObject)
I start the Ants profile session using IIS original port and I have the Tools>Advanced Options>"Simplify very complex stack traces" and Avoid Profiling extremely trivial Method" unchecked.
IE gets launched to my homepage controllers.
Then I execute calls in fiddler and get 200 responses for all 4 calls with approrpiate response bodies.
I then go back to ANTS and stop the profile. In the methods view I need to uncheck the "Hide insignificant methods" checkbox as these apis are very simple.
I can see the data for api for the simple Post(int id) and Get(int id) but not the other two.
Here is the controller class.
Here are the calls I make in fiddler