One of the operations in my Web application involves a function that returns a value, which then needs to be passed to a web service method running separately from the application. This web service operation takes some time to complete and therefore must run in the background, with a message returned upon completion. I aim to achieve this using Javascript callbacks following a basic code flow as outlined below:
Dim shr_intfB_Common_LCI As clsCreamsCommon
Dim stringResult As StringResult
shr_intfB_Common_LCI = New clsCreamsCommon
Call shr_intfB_Common_LCI.CreamsBooking(clsTapsCreamsPropsDtl,
intRetCode, strMessage, intRequestId
)
// The intRequestId should be sent to the specified web service.
Do
Threading.Thread.Sleep(10 * 1000) '10 Second
stringResult = objService.CheckRequestStatus(objServiceUser, intRequestId)
Loop Until stringResult Is Nothing Or stringResult.ReturnCode <> 2
//The stringResult contains information that needs to be displayed.
MessageBox(Me, stringResult.ReturnCode, stringResult.ReturnData + stringResult.ReturnMessage)
I am seeking a solution for this without utilizing Threads or Task due to the nature of being a web application, but through the use of JavaScript callbacks instead. Assistance on this matter would be greatly appreciated.