1
PHP가 웹 서비스에 정보를 보내고 연결하려고 시도하지 않았습니다. 설정 시간이 입니다. 나는 아래에서 사용하고 있으며 어떤 이유로 그것이 허용 된 시간 동안 실행되며 나는 이유를 알 수 없다. 예를 들어 30 초로 설정하면 어떤 경우에는 더 오래 걸리는 것으로 나타납니다. 너무 오래 걸리면 100 % 연결을 끊는 방법을 찾아야합니다.PHP 시간 제한이 웹 서비스에서 작동하지 않습니다.
TIA, 윌
$intTimeout = $this->getTimeout(); $client = new SoapClient("{$this->url}?WSDL", array('trace' => 0, 'connection_timeout'=>$intTimeout)); try { $this->response = $client->someService($objPerson); } catch(Exception $e) { } $this->restoreTimeout();
function getTimeout() { $intTimeout = @$this->timeout ? $this->timeout : 60; $_SESSION['old_sock'] = ini_get('default_socket_timeout'); ini_set('default_socket_timeout', $intTimeout); return $intTimeout; } function restoreTimeout() { $intCurSockTime = @$_SESSION['old_sock']; if($intCurSockTime) ini_set('default_socket_timeout', $intCurSockTime); }