[TYPO3-dev] try and catch a soap warning...

Jigal van Hemert jigal at xs4all.nl
Tue Jan 19 15:50:28 CET 2010


Hi list,

Although the problem is with PHP, it is inside a TYPO3 extension and 
this might influence the things I experience:

try {
	$client = new SoapClient($wsdl_url);
} catch (Exception $e) {
	//do something with $e->getMessage()
}

The problem is that although the code inside the catch{} is executed 
there are still warnings displayed in the browser when the connection 
failed:

Warning: SoapClient::SoapClient(http://xxxxxxxxxxxxxxx) 
[function.SoapClient-SoapClient]: failed to open stream: Connection 
timed out in /html/typo3conf/ext/path.to.script.php on line 152

Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O 
warning : failed to load external entity "http://xxxxxxxxxxxxxxxx" in 
/html/typo3conf/ext/path.to.script.php on line 152

line 152 is the line with the new SoapClient() on it.

Any ideas on how to prevent the warnings from being displayed with a 
try/catch construction?

Regards, Jigal.




More information about the TYPO3-dev mailing list