Category
While working on a project accessing a slow web service, I found myself needing to extend the timeout of the HTTPRIO component. The web service, when executed straight from a browser, would happily take as long as it needed to before successfully completing. But my Delphi application was timing out.
It's not terribly intuitive how to do it, but if you search for "HTTPRIO timeout" you'll find several web references from a variety of sources all saying exactly the same thing. Word for word.
Instead of testing against the customer's data, which has a varying amount of data and is sometimes fast and sometimes slow, I wrote my own to give me back a whole bunch of data that would purposefully and predictably take a long time.
The easiest way to create that ended up being an ASP.NET Web Service from a template in Visual Studio 2008. I called it Big Data.
The suggestion in the web pages worked perfectly and the source code written in Delphi 2010 (without any 3rd-party components) is attached below.
While refreshing my memory on how to write and consume web services, I wrote another one that simply returns the current time on my server. It's called simply enough, Current Time. The files for this one are also attached here, just in case anyone is interested in a very simple web service call from Delphi.
NOTE: The Windows web server at my home office has been replaced by a Linux server and I have not re-written the web services to work under Linux. So instead of being able to actually test out the web services, I've simply attached the C# code to both projects here.
Attachment | Size |
---|---|
CurrentTimeClientExe.zip | 889.8 KB |
CurrentTimeClientSrc.zip | 6.2 KB |
BigDataClientExe.zip | 448.69 KB |
BigDataClientSrc.zip | 6.85 KB |
CurrentTimeServerCS.zip | 2.65 KB |
BigDataServerCS.zip | 2.75 KB |