JeremyDunn / php-fedex-api-wrapper

This library provides a fluid interface for constructing requests to the FedEx web service API.
269 stars 184 forks source link

Ability to add timeout to requests #86

Closed dbarrington closed 5 years ago

dbarrington commented 5 years ago

I've noticed that fedex responses for address validation have been a little slow. Is there is a way to set a timeout on the call? I would like to bypass the validation if it takes over x secs.

JeremyDunn commented 5 years ago

Looks like you can set the timeout for the PHP SoapClient by setting the default_socket_timeout value via ini_set().

http://php.net/manual/en/soapclient.soapclient.php

The connection_timeout option defines a timeout in seconds for the connection to the SOAP service. This option does not define a timeout for services with slow responses. To limit the time to wait for calls to finish the default_socket_timeout setting is available.