Solved

Call soap web service asynchronously in Delphi XE

Posted on 2013-10-28
2
1,807 Views
Last Modified: 2016-02-26
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?
0
Comment
Question by:lefodnes
2 Comments
 
LVL 26

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39606229
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
 

Author Closing Comment

by:lefodnes
ID: 39640961
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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi XE10 Round Image 2 162
Delphi 2 69
Delphi: sending SMS on android platform 1 38
How to add columns to a RAD Studio FMX grid at design time 1 6
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question