I have the following PHP code on a web page:
$wsdl_url = "someURL?wsdl";
try {
$client = new SoapClient($wsdl_url, array('login' => 'mylogin','password' => 'mypassword'));
$client->myWebMethod(); // <-- problem call
} catch (Exception $e) {
echo "none";
}
It's a basic call to a web service. The problem is that when an error is thrown on the line $client->myWebMethod()
, echo "none"
is not printed. In fact, nothing in the catch
block runs. Hence, I don't think the exception is being caught.
A fatal error is displayed on the web page.
Question: Any ideas on why this is happening? I expected all exceptions to be caught and handled with this code. But what I'm getting is that the fatal error is being displayed on the page. Maybe web services are handled differently?
EDIT: the error is that it's missing a bunch of required parameters. if I add the parameters the call works fine. I am purposely omitting the parameters to get the error, so i would know how to handle it.
The error is something like: Fatal error: SOAP-ERROR: Object hasn't 'myparameter1'
Thanks in advance.