What's the different between BeginInvoke and InvokeAsync

Locked What's the different between BeginInvoke and InvokeAsync

  • Tuesday, February 14, 2012 1:20 AM
     
     

    Hi

    In  System.Web.Services.Protocols.SoapHttpClientProtocol, there is  two method "BeginInvoke ","InvokeAsync". Looks like all used to call webservice asynchronism. But what's the different for them?

All Replies

  • Tuesday, February 14, 2012 9:02 AM
     
     Answered

    1. Begin Invoke is supported from 1.0 framework on the other hand InvokeAsync is fairly newer and supports  2.0 framework onwards.

    2. Begin Invoke returns IAsyncResult while InvokeAync is void.

    3. MSDN says, Begin Invoke - Starts an asynchronous invocation of an XML Web service method using SOAP while InvokeAsync - Invokes the specified method asynchronously.Additonal information can be supplied by caller usin Begin Invoke.                                              

    4. InvokeAsync uses the thread from threadpool to resume, whilst Begin Invoke will use current host thread. (Not absoultely sure)                                                                                                                                                                                           



    • Edited by Prasanna A Tuesday, February 14, 2012 9:03 AM
    • Edited by Prasanna A Tuesday, February 14, 2012 9:03 AM
    • Proposed As Answer by Prasanna A Tuesday, February 14, 2012 9:03 AM
    • Marked As Answer by carson.h Tuesday, February 14, 2012 9:14 AM
    •  
  • Tuesday, February 14, 2012 9:14 AM
     
     
    Got it.Thank you.