You might have noticed that the interface freezes when making webservice
calls. Really not acceptable, and you'd think easily solved by threading
them.
Anyone have a working example?
Here's how to do it. I was forgetting to call CoInitialize as the first
line of the thread's Execute, rather than it's create. Issue one down.
Second, I couldn't get a THTTPRIO that I created in the thread to work
correctly. So I put one on a TDataModule, set the WDLLocation, Service and
Port, then run-time created the TDataModule in the thread. Works great.
I then created an Event for the thread, and attached a procedure from the
main form to that event. DoComplete gets fired by the thread when the data
is available, and the memo box picks up the string from the thread's public
string result variable. Don't forget to Synchronize! Too easy.
No interface freeze while the threaded SOAP call executes. Very cool.
Posted to borland.attachments, as FedExThreaded.zip. Many special thanks to
Shiv Kumar (The Delphi Apostle) for his orginal FedEx example. Secondary
thanks to Nick Hodges, just for being you.
Next, I'll create a special event for errors in executing the SOAP call
(What happens when the server is down, etc.) and also try to set the
WDLLocation, Service and Port at run-time (What if we don't know what the
DNS name of the server is until runtime, but we know the function we want to
call [perfect for p2p]).
Thanks for the help, all.
Sw.
"linkrequest" <linkr...@bluebinder.com> wrote in message
news:3b3f8dac$1_2@dnews...