rockyjvec / Onvif

PHP Onvif library for IP cameras.
20 stars 15 forks source link

Problem calling WSDL defined functions #7

Open belefevre opened 1 year ago

belefevre commented 1 year ago

Hi, I'm trying to use your lib and it work for basic data collection but each time I try to call a function, I receive this error.

$o = new Rockyjvec\Onvif\Onvif($SrvURI, $user, $password); //var_dump($o);

$event = $o->events;
//var_dump($o->media);
$f=$o->media->GetProfiles();

==>> ( ! ) Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] in C:\wamp64\www\ONVIF2\vendor\rockyjvec\onvif\src\Rockyjvec\Onvif\Soap\SoapClient.php on line 61 ( ! ) SoapFault: in C:\wamp64\www\ONVIF2\vendor\rockyjvec\onvif\src\Rockyjvec\Onvif\Soap\SoapClient.php on line 61 Call Stack

Time Memory Function Location

1 0.0044 362120 {main}( ) ...\index.php:0 2 0.1364 404560 Rockyjvec\Onvif\Soap\SoapClient->GetProfiles( ) ...\index.php:8 3 0.1364 404560 Rockyjvec\Onvif\Soap\SoapClient->call( $method = 'GetProfiles', $args = [] ) ...\index.php:8 4 0.1366 414112 call( $name = 'GetProfiles', $args = [] ) ...\SoapClient.php:61

As you can see, I'm working on Windows with PHP 8.0.26

Any idea ? Thanks

rockyjvec commented 1 year ago

That exception appears to be coming from the PHP soap library. Maybe try var_dumping the exception and see if there is some more helpful information contained within it like:

try {
    $event = $o->events;
    //var_dump($o->media);
    $f=$o->media->GetProfiles();    
} catch (Exception $ex) {
    var_dump($ex);
}