Solved

Call soap web service asynchronously in Delphi XE

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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