On Friday 09 July 2010 4:49:17 am am am wrote: > Hi, I would like to understand how the asynchronous invocation model works. > If for example I use Future<?> invokeAsync(T msg, AsyncHandler<T> handler) > then my program can resume and when the response from the web service > arrives, the result will be passed to my AsyncHandler. > If I have several threads in the same program and one thread calls > invokeAsync and resumes operation and immediately another thread (perhaps > more) tries to also call invokeAsync to the same web service (perhaps > different operation but same portType) how will this situation be handled > by the framework? a) Will a series of POSTs go the same web service (POST > for thread1, POST for thread2 etc) or b) after a response arrives then the > next POST will be send (POST for thread1 when response arrives pass result > to the callback handler and then POST for thread2?). If you follow > approach (a) you push the POSTs over the same TCP connection?
Internally, a new HttpURLConnection object is created everytime any invoke (or invokeASync) method is called. The HttpURLConnection pretty much manages most of the above. If there is a free "keep-alive" connection avail, it uses it. If not, it creates a new one. -- Daniel Kulp [email protected] http://dankulp.com/blog
