Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WebServices client in thread?

27 views
Skip to first unread message

linkrequest

unread,
Jul 1, 2001, 4:51:44 PM7/1/01
to
Anyone tried putting webservices request code into a thread yet? I've been
trying, but I get the (infamous) 'MSXML not installed' message, even though
I CoInitialize(nil) on the creation of the thread.

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?


linkrequest

unread,
Jul 1, 2001, 7:21:58 PM7/1/01
to
Answered my own question.

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...

0 new messages