Solved

Call soap web service asynchronously in Delphi XE

Posted on 2013-10-28
2
1,897 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month6 days, left to enroll

626 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