Calling asynch within a web service
Previously I had a project split into an asp.net page and a web service. I have two 'worker' web methods that can run side by side (asynch) and I found that I got a speed advantage when I did that. The way I called it was:
And I called the other just like it. Then I would wait for the response before moving on:
But now I have moved this calling code into the web service itself. I was wondering if there is a way to call these two methods from within the web service asynchronously?
Basically what I did was encapsulate my web service so that it only exposes a single web method and then that web method calls other private functions within the web service.
Do I need to use threads?
Previously I had a project split into an asp.net page and a web service. I have two 'worker' web methods that can run side by side (asynch) and I found that I got a speed advantage when I did that. The way I called it was:
PHP:
Dim obj As New TransService.TransService
obj.Timeout = -1
Dim ConvertResult As IAsyncResult
Try
OracleConn.Open()
ConvertResult = obj.BeginConvert(LOCAL_Path, Zone, Unit, FileType, Nothing, Nothing)
Catch ex As Exception
Finally
OracleConn.Close()
End Try
And I called the other just like it. Then I would wait for the response before moving on:
PHP:
Try
Dim asyncResult As String
asyncResult = obj.EndConvert(ConvertAnnoResult)
If asyncResult <> "Success" Then
Me.txtError.Text = "Error in the Convert procedure :: " & asyncResult
End If
Catch ex As Exception
End Try
But now I have moved this calling code into the web service itself. I was wondering if there is a way to call these two methods from within the web service asynchronously?
Basically what I did was encapsulate my web service so that it only exposes a single web method and then that web method calls other private functions within the web service.
Do I need to use threads?
Last edited: