Double Processing within C# asmx

  • Thread starter Thread starter Stevenson
  • Start date Start date
S

Stevenson

Hello.

If have written a webservice within C# that is called from
an aspx and processes incoming data correctly. The problem
is that the ASMX runs twice before returning. I have
debugged the application and can see the ASMX duplicate
the processing effort. In debug I can see it hit the
return method, but instead of returning to the caller
immediately it reprocesses the data a second time before
properly returning to aspx caller.

Is there a dispose or close method that I need to call in
addition to or instead of simply returning from the main
method?

Any help appreciated.
 
No, there are no additional methods that need to be called in this scenario.
Since you mentioned the caller is an aspx page, check there first to
determine that you aren't actually calling the service more than once. This
happens often by accident with aspx pages due to forgetting a postback
check, event handler doing the same thing, etc....

If you can definitively rule out aspx as the culprit, try to view the http
request coming in to the web service. Alternately, to absolve the service
as the problem, try writing a 'lastaccessed.txt' file that stamps the time
and a guid to each request when the method in question is acessed. If you
only find one request and two executions, then yes, I'd agree something is
recursive in the process (but maybe a not .NET issue -- network, iis,
etc...)

Trebek
 
Back
Top