0

I have a web method to get the flight data from airline, we make asynchronous call to get available flights and then for each flight we again make again make asynchronous call to get the price. It looks like one thread is making using of the response we get from other thread.

Consider a search criteria LHR (London) - CDG (Paris) one way search. We got 3 flights for the route (flights A, B and C), then we make 3 async calls for getting the fare for each flight, this is done by calling airline web service method.

My query is can flight1 uses the fare response we got for flight 2 ?

for(int a=0;a< flightcount;++i)
{
    MethodDelegate  dglt;
    dglt = new MethodDelegateCP(GetClassBasedResponseAsync);
    asyncResultIn = dglt.BeginInvoke(a, null, null);
}

private ArrayList GetClassBasedResponseAsync(string flightno)

Make a airline webservice call to get the fare response.

WebResponse response = request.GetResponse();

Some logic to process the response and return the result back to the calling function

Is there any possibility that WebResponse we got for flight A is processed for flight B, i.e thread for flight A is making use of response we got for Thread B.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Shamil
  • 13
  • 2
  • How do you save the responses? Where's asyncResultIn being used? – Thomas Lindvall Jun 15 '14 at 15:35
  • from the "for loop" 3 async calls are made to the function "GetClassBasedResponseAsync" to get fare for flight A,FlightB and Flight C which internally makes a webrequest call to the Airline webservice webreponse we receive for FlightA can it be processed as a response for FlightB call in "GetClassBasedResponseAsync" ? all the variables or webrequest calls we are make are not isolated from each other (async call)?? we log all the req/res we make to airline flightA Req FlightB req FlightA Res in abv scenario i feel code is treating respone of flight A as of Flight B – Shamil Jun 16 '14 at 08:51

0 Answers0