Timeout while accessing webservice over SOAP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ab-tools
Forum Newbie
Posts: 2
Joined: Fri Aug 28, 2009 4:50 pm

Timeout while accessing webservice over SOAP

Post by ab-tools »

Hello,

I try to access a webservice with PHP that takes quite long to respond (I've tested it with the free program "soapUI" and it takes about 65 seconds until I get an answer). Therefore the PHP script is always interrupted before the webservice has sent the response. Here is the very short PHP snippet I use for testing:

Code: Select all

$client = new SoapClient("https://my.server/past/to/webservice.asmx?wsdl");
echo "test1"
$result = $client->GetProducts(array("param1"=>"value1", "param2"=>"value2", "param3"=>"value3", "param4"=>"", "param5"=>""));
echo "test2"
The result is that "test1" is printed but it never gets to the position of "test2" in the code. The script is always interrupted while executing the line "$result = $client->GetProducts([...])".

I already increased all timeouts I could find:
"max_execution_time" to "3560"
"max_input_time" to "3560"
"default_socket_timeout" to "3560"

And I executed the PHP script from within a browser and from the Linux shell with "wget" (to be sure additional with the option "--timeout=3560"). Always with the same result: no result at all. :(

I even tried to add a try-catch block arround the SOAP call, but there is also no exception. The script is just interrupted without any error message...

Does anyone have an idea about which timeout I have to increase that the webservice call is not interrupted before it could send the result?

Thanks for any ideas in advance
Andreas
joeynovak
Forum Commoner
Posts: 26
Joined: Sun May 10, 2009 11:09 am

Re: Timeout while accessing webservice over SOAP

Post by joeynovak »

I use this line of code when I have a script that takes a long time...

Code: Select all

set_time_limit(60 * 60);
This sets it to 60 minutes.

I think the values you set should be right though, I would double check that you are modifying the right php.ini file by running php_info(); and ensuring you are editing the one it says. (I know I've banged my head against the wall for HOURS and then realized I was editing the wrong file.

Cheers!

Joey
ab-tools
Forum Newbie
Posts: 2
Joined: Fri Aug 28, 2009 4:50 pm

Re: Timeout while accessing webservice over SOAP

Post by ab-tools »

Hello Joey,
joeynovak wrote:I use this line of code when I have a script that takes a long time...

Code: Select all

set_time_limit(60 * 60);
This sets it to 60 minutes.

I think the values you set should be right though, I would double check that you are modifying the right php.ini file by running php_info(); and ensuring you are editing the one it says. (I know I've banged my head against the wall for HOURS and then realized I was editing the wrong file.
Thank you, but the 3 timeouts are already set as written in my first post. I've checked that with phpinfo().

But the script still hangs at the webservice request.

Do you have any idea which other timeout exists that causes to cancel the script?

Thanks again
Andreas
Post Reply