Solved

Call soap web service asynchronously in Delphi XE

Posted on 2013-10-28
2
1,753 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
add combobox item based on numbers 9 123
Delphi inherited method 6 63
control image tags in a string ? 12 110
DBGrid or StringGrid ? 6 68
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now