I tried to do async webservice(Helloworld) call using windows application 3.5 using delegate AsyncCallback but the problem was I could not get any BeginInvoke(BeginHelloworld) or EndInvoke(EndHelloworld) methods in intellisense.I did use proper namespace and required interface ,IAsyncResult but It gives me complie time error.what exactly I require to do, to write the code like .net winform 1.1.

Thank you,

Member Avatar for Unhnd_Exception

Heres one way I send a web service async.

This doesn't actually call the web service async but calls another method async that calls the web service sync.


The delegate and sub

Private Delegate Sub SendMessageDelegate(ByVal Messages As List(Of Byte()))

Private Sub SendMessages(ByVal Messages As List(Of Byte()))
'The web method called sync in here.
End Sub

When I'm calling it from another form

Dim SendAsyn As New SendMessageDelegate(AddressOf SendMessages)
 Dim IasyncResult As IAsyncResult = SendAsyn.BeginInvoke(Messages, Nothing, Nothing)

If I call the web service async I usually just use the built in async method of the web service.

For example:

Sm as new SendMailService

and say SendMailService has a method named SendMail

You can call it async by

Sm.SendMailAsync

you can then use the SendMailCompleted Method to handle when its finished.

Member Avatar for Unhnd_Exception

You should declare your web service

private withevents Sm as new SendMailService

to use the SendMailCompleted Event.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.