Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asynchronous Web Service Call and Tracking

Status
Not open for further replies.

Genimuse

Programmer
May 15, 2003
1,797
US
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
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
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top