I don't see the call like
My.WebServices.XYZService.getXYZAsync()
being made or post handler attached.
Example is in VB but hopefully will give the directions to go ahead. Try following steps:
1. Reference the XYZ Web service
2. Add an event handler for the getXYZCompleted event:
Private Sub getXYZCompletedHandler(ByVal sender As Object,
ByVal e As net.xmethods.www.getXYZCompletedEventArgs)
MsgBox("XYZ: " & e.Result)
End Sub
3. Add a field to track if the event handler has been added to the getXYZCompleted event:
Private handlerAttached As Boolean = False
4. Add a method to add the event handler to the getXYZCompleted event, if necessary, and to call the getXYZAsync method:
Sub CallGetXYZAsync(ByVal zipCode As Integer)
If Not handlerAttached Then
AddHandler My.WebServices.
XYZService.getXYZCompleted,
AddressOf Me.TS_getXYZCompleted
handlerAttached = True
End If
My.WebServices.XYZService.getXYZAsync(zipCode)
End Sub
To call the getXYZ Web method asynchronously, call the CallGetXYZAsync method. When the Web method finishes, its return value is passed to the getXYZCompletedHandler event handler.
Reference:
How to: Call a Web Service Asynchronously - Visual Basic | Microsoft Docs[
^]