I’ve create a regular old ASMX web service in ASP.NET and added SoapDocumentMethod(OneWay = true)] to the function call as I’ve read this is supposed to make the call Asynchronous. However I call this in my code and it definitely does not make the call asynchronous, my page just sits there waiting for the function to finish working. What gives?
[SoapDocumentMethod(OneWay = true)]
[WebMethod(EnableSession = true)]
public void UpdateAccounts()
{
//do work
}
//call the function
GlobalServices service = new GlobalServices();
service .UpdateAccounts()
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You still have to make the call using the Async method. You should make the call to service.UpdateAccountsAsync() in this case.
Method 2
Are you returning a value? The documentation for OneWay states that “fire and forget” web methods cannot return a value or have out parameters.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0