WS End
Client definition new class public class class1 private m_wsdata as new localhost.service1
Public Function beginhellow () As IAsyncResult Try Return m_WsData.BeginHelloWorld ( "Good afternoon", Nothing, New Object) Catch ex As Exception MessageBox.Show ( "beginhellow error!" & Ex.Message & vbNewLine & ex.StackTrace) Return Nothing END TRY END FUNCTION
Public Function Endhellow (ByVal ar As IAsyncResult) As String Dim temp As String Try Return m_WsData.EndHelloWorld (ar) Catch ex As Exception Return "Endhellow error!" & Ex.Message & ex.StackTrace End Try End FunctionEnd Class
Client Using DIM TEMP AS New Class1 Dim Ar As IasyncResult Ar = Temp.BeginHellow () 'ar.asyncwaithandle.waitone ()
IF (ar.iscompleted) THEN DIM Result As String Result = Temp.Endhellow (ar) textbox1.text = result endiff