Call soap web service asynchronously in Delphi XE

I'm using Delphi XE to import a WSDL. This produces a .pas file as expected, and I can use the method exposed in the web service synchronously.

How do I do this asynchronously?
lefodnesAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Sinisa VukConnect With a Mentor Commented:
You probably want time out on soap request? I'm trying to use timeouts but without success. So, I suggest to use separate thread (where you create soap request and wait for response). Thread can be destroyed or ignored and your main thread is not locked - just like asynchronous call. Thread can call some event to inform when result is available.

I recommend to use TBMDThread. Get it from www.torry.net
OmniThreadLibrary is little complex but good alternative too. Using one of them you can easily set you soap call as a working job.

job:
...
FRIO := THTTPRIO.Create(nil);
try
  //call soap method and get result
  if Assigned(FMyEvent) then FMyEvent(Res); //notify main  thread
finally
  FRIO.Free;
end;

Open in new window

0
 
lefodnesAuthor Commented:
Using thread as I expected. Doesn't seems like Delphi XE support asynchronous web method calling, so it's probably the only way besides writing the http requests from bottom up.
0
All Courses

From novice to tech pro — start learning today.