Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Soap Delphi Client end with a timeout for a 1MB call

we are developing a SOAP webservice (Apache/PHP). All run well for small size calls, but with a 1Mb soap call (the HTTPS call size is 1MB) our Delphi Soap client stop with a timeout on all PC but one, and our PHP clients run well with a default_socket_timeout=300, but stop with a "Error Fetching http headers" with default_socket_timeout=60.

How can we change the timeout for Delphi? In fact this timeout seem to be in a Windows XP network library (wininet.dll called by soaphttptrans.pas)

Thanks
Cédric

like image 378
Cédric Girard Avatar asked Apr 16 '10 15:04

Cédric Girard


2 Answers

In fact it was a problem with IE7 installation : it change all the network timeout.

PC with IE6 have a 3600 secondes timeout, IE7 change it to 30 secondes. Use of InternetQueryOption() show this, and InternetSetOption help to change this.

Big thanks to my work mate wich hunt the bug for hours.

like image 99
Cédric Girard Avatar answered Sep 20 '22 17:09

Cédric Girard


There's a MaxSinglePostSize in SOAPHttpTrans. I seem to recall having issues with that. This isn't a limit, but it behaves differently (breaks up into chunks for sending) if you're over, or under that limit. (basically 32768 by default). I expect you'll hit that size sooner if you're on D2009/D2010 due to widestrings. It would be interesting to see if you run into trouble around that size. You can use Fiddler to capture some output (or hook into the OnBeforePost event and dump the serialized XML to a file yourself) and see if that's where you run into trouble, instead of the previously observed 1MB.

But anyway, the THTTPReqResp class has options for SendTimeout and ReceiveTimeout. Try adjusting those.

Also... if you are using Delphi prior to Delphi2007, you should update your soap libraries. There's a download somewhere... many bug fixes, including a nasty memory issue that will cause your app to be halted by DEP.

like image 39
Chris Thornton Avatar answered Sep 21 '22 17:09

Chris Thornton