I am writing an ASP.NET web service using C # where there is a DoLookup () function. For each call to the DoLookup () function, I need my code to execute two separate requests: one to another web service on the remote host, and the other to the local database. Both queries must complete before I can compile the results and return them as an answer to the DoLookup method. The problem I'm dealing with is that I want to make it as efficient as possible, both in terms of response time and resource usage on the web server. We expect up to several thousand requests per hour. Here's a rough C # -shaped overview of what I still have:
public class SomeService : System.Web.Services.WebService
{
public SomeResponse DoLookup()
{
WebResponse wr = RemoteProvider.DoRemoteLookup();
DBResponse dbr = DoDatabaseLookup();
SomeResponse resp = new SomeResponse( wr, dbr);
return resp;
}
}
, . , DoRemoteLookup() (RemoteProvider BeginRemoteLookup/EndRemoteLookup) BeginExecuteNonQuery/EndExecuteNonQuery.
() : - , , ?
, , , (1 2 ), - , . . -, , , . , , - , , , , .
.