Cancel async web service calls

后端 未结 1 872
执笔经年
执笔经年 2021-01-22 08:03

I need to be able to cancel async calls made to my webservice. One solution I have is to use manage my own threads, and use synchronous methods from the SOAP client. This works

1条回答
  •  一生所求
    2021-01-22 08:44

    Yes, you can use Abort method but keep below notes in mind. You can also use CancelAsync.

    Abort notes: http://msdn.microsoft.com/en-us/library/aa480512.aspx

    When you call the Abort method, any outstanding requests will still complete, but they will complete with a fault. This means that if you are using callbacks, your callback function will still be called for each outstanding request . When the EndInvoke method is called, or in our case, the wrapper function EndDelayedResponse, then a fault will be generated indicating that the underlying connection has been closed.

    CancelAsync example: http://www.codeproject.com/KB/cpp/wsasync.aspx

    0 讨论(0)
提交回复
热议问题