thread and webservice

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

I am building an application that I would like to invoke a web service in
the background without interrupting the application from functioning
normally. I am putting the call to the web service in a seprate thread but
when the call is made to the web service, the thread with the web service
will not let anyother processes happen until it is done. Has anyone worked
around this?
 
Are you sure you're calling it asynchronously?

If you haven't already, try using a Callback method to handle the call.
Thats what I did and it works fine, doesn't halt the user at all.

// Dave



I am building an application that I would like to invoke a web service in
the background without interrupting the application from functioning
normally. I am putting the call to the web service in a seprate thread but
when the call is made to the web service, the thread with the web service
will not let anyother processes happen until it is done. Has anyone worked
around this?
 
Richard,

I've built some fairly complicated Compact Framework applications that
consume Web Services, and I've seen nothing that matches what you've
described.

I mostly use the Asychronous method calls that are automatically generated
by the compile (BeginMethodName, EndMethodName), but have also called web
services from a background thread. All of these methods work well, and keep
my GUI from locking up.
 
The application respondes once the webservice is done. I am doing this in VB
..Net so I don't know if that is makes a difference on using thread in a
application. I am not updating the interface with anything. All I have is
the webservice call in the thread.
 
I am now getting the desired effects by callung the webservice Asychronous
method calls from within one of my threads that I created. Thanks to
everyone.
Dim iAsync As IAsyncResult

iAsync = websvc.BeginUploadChanges(gUserID, gUsername, ds, LastSyncDate,
newSyncDate, gPassword, Nothing, Nothing)

iAsync.AsyncWaitHandle.WaitOne()

newDS = websvc.EndUploadChanges(iAsync)
 
Back
Top