Re: ext/soap ctor errors
| From: | Knut Urdalen | Date: | Mon, 08 Jan 2007 13:51:59 +0000 |
| Subject: | Re: ext/soap ctor errors | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27336@lists.php.net to get a copy of this message | ||
I agree with Lukas here, currently you have to be proactive against the location of the WSDL-file. I currently do like this in my SoapClient's:
class MySoapClient extends SoapClient {
public function __construct($wsdl ,$options = array()) {
if(is_resource(@fopen($wsdl, 'r'))) {
parent::__construct($wsdl, $options);} else {
throw new Exception("Parsing WSDL: Couldn't load from '$wsdl'");
}
}
}
to be able to catch that problem as an Exception.
Regards,
Knut Urdalen
Lukas Kahwe Smith wrote:
Hi, why do I get warnings when I have failures in my ext/soap ctor? try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl', array('exceptions' => true)); } catch (Exception $e) { } I guess even without the 'exceptions' => true it should always return all issues as an exception. I think this was agreed upon for constructor errors in PHP5, no? regards, Lukas