Home » Web Services » SOAP » Bug #2796
Timeout on SOAP Connection
Details
| Request #2796 | Timeout on SOAP Connection |
|---|---|
| Submitted | 2004-11-19 15:39 UTC |
| From | whelan at nexserver dot com |
| Status | Duplicate |
| Package | SOAP |
| PHP Version | 4.3.7 |
| OS | Both Windows & Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-11-19 15:39 UTC] whelan at nexserver dot com
Description:
------------
A timeout occurs on SOAP connections without waiting a proper time. The usual default SOAP timeout value is 30 seconds, but this value isn't set anywhere. I have fixed this problem for my application by doing the following:
In the generateProxyCode function in the SOAP_WSDL class (WSDL.php), one line of code setting the timeout option in SOAP_Client class should be added to the dynamically generated php code in the constructor of the class that extends SOAP_Client.
I added it dynamically to two lines of code ( lines 476 & 482 ).
Reproduce code:
---------------
$this->setOpt("timeout", 30); // add to dynamic php code
// lines 475-476
$class .= "));\n".
" \$this->setOpt(\"timeout\", 30);\n }\n";
// lines 479-483
$class = "class $classname extends SOAP_Client\n{\n".
" function $classname()\n{\n".
" \$this->SOAP_Client(\"$clienturl\", 0);\n".
" \$this->setOpt(\"timeout\", 30);\n".
" }\n";
Expected result:
----------------
When the above code is run (in the existing file WSDL.php), the SOAP connection will wait 30 seconds before timing out. Where before it was timing out well before this mark.