I'm sending some information to a web service, and it replies with an integer code to tell me whether the format was accepted or if there were problems. Because I could be doing this multiple times and in the background while the user does other stuff, and because the internet connection could be slow (Pocket PCs with phone connections), I want to do it asynchronously. However, I need to know which send was just successful so I can delete the data locally (don't need it once it's sent).
Is there some kind of handle or something I can store at the sending and reference upon receipt. Basic code looks like this:
The web service
The call to the web service
The processor of the results
I'm looking for maybe something I can set during the call, like a handle I can associate with a unique identifier in my data sent, that I can retrieve during the processing of the callback.
Any ideas? Am I going about this the hard way? Thanks in advance for any ideas.
Is there some kind of handle or something I can store at the sending and reference upon receipt. Basic code looks like this:
The web service
Code:
Dim webService As New com.companyname.webservices.CheckList
The call to the web service
Code:
Dim wsCallback As New AsyncCallback(AddressOf ProcessCallBack)
webService.BeginSubmit(xmlForm, wsCallback, Nothing)
The processor of the results
Code:
Sub ProcessCallBack(ByVal Response As IAsyncResult)
Dim responseCode As Integer
responseCode = webService.EndSubmit(Response)
End Sub
Any ideas? Am I going about this the hard way? Thanks in advance for any ideas.