Coder Social home page Coder Social logo

onvif-client-php's Introduction

ONVIF client library classes

ONVIFDevicemgmt

The class uses slightly modified devicemgmt.wsdl where endpoint is defined and the reference to onvif.xsd is fixed. The endpoint is overwritten with the parameter but it is still needed

example:

include( 'inc/ONVIFDevicemgmt.inc.php' );
ini_set( 'default_socket_timeout', 1800 ); 
$wsdl    = 'http://localhost/WSDL/devicemgmt-mod.wsdl';
$service = 'http://192.168.0.1:888/onvif/device_service';
$username = 'username';
$password = 'password';
$client = new ONVIFDevicemgmt( $wsdl, $service, $username, $password);
try {
	$res = $client->get_network_interfaces();
	var_dump( $res );
} catch ( Exception $e ) {
	print "SOAP error occured\n";
	$res = $client->client->__getLastRequest();
	print "Last request:\n";
	print( $res . "\n" );
	$res = $client->client->__getLastResponse();
	print "Last response:\n";
	print( $res . "\n");
}

ONVIF PTZ client library class

The class uses slightly modified ptz.wsdl where endpoint is defined and the reference to onvif.xsd is fixed. The endpoint is overwritten with the parameter but it is still needed

include( 'inc/ONVIFPTZ.inc.php' );
ini_set( 'default_socket_timeout', 1800 ); 
$wsdl    = 'http://localhost/WSDL/ptz-mod.wsdl';
$service = 'http://192.168.0.1:888/onvif/device_service';
$username = 'username';
$password = 'password';
$client = new ONVIFPTZ( $wsdl, $service, $username, $password);
try {
	$client->response_dump( 'GetServiceCapabilities', $client->get_service_capabilities() );
	$client->response_dump( 'GetNodes', $client->get_nodes() );
	$client->response_dump( 'GetNode', $client->get_node('ptz0') );
	$client->response_dump( 'GetConfigurations', $client->get_configurations() );
	$client->response_dump( 'GetConfiguration', $client->get_configuration('ptzconf0') );
	$client->response_dump( 'GetConfigurationOptions', $client->get_configuration_options('ptzconf0') );
} catch ( Exception $e ) {
	print "SOAP error occured\n";
	$res = $client->client->__getLastRequest();
	print "Last request:\n";
	print( $res . "\n" );
	$res = $client->client->__getLastResponse();
	print "Last response:\n";
	print( $res . "\n");
}

ONVIF Media client library class

The class uses slightly modified media.wsdl where endpoint is defined and
the reference to onvif.xsd is fixed. The endpoint is overwritten with the
parameter but it is still needed

include( 'inc/ONVIFMedia.inc.php' );
ini_set( 'default_socket_timeout', 1800 ); 
$wsdl    = 'http://localhost/WSDL/media-mod.wsdl';
$service = 'http://192.168.0.1:888/onvif/device_service';
$username = 'username';
$password = 'password';
$client = new ONVIFMedia( $wsdl, $service, $username, $password);
try {
	$client->response_dump( 'GetProfiles', $client->get_profiles() );
} catch ( Exception $e ) {
	print "SOAP error occured\n";
	$res = $client->client->__getLastRequest();
	print "Last request:\n";
	print( $res . "\n" );
	$res = $client->client->__getLastResponse();
	print "Last response:\n";
	print( $res . "\n");
}

onvif-client-php's People

Contributors

mapbuh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

onvif-client-php's Issues

PHP 5.6.30 error

PHP 5.6.30

This error Call to undefined method ONVIFMedia::get_system_date_and_time() in /var/www/html/onvif-client-php/inc/ONVIF.inc.php on line 45

`<?php
include( 'inc/ONVIFMedia.inc.php' );
ini_set( 'default_socket_timeout', 1800 );
$wsdl = 'http://127.0.0.1/onvif-client-php/WSDL/media-mod.wsdl';
$service = 'http://192.168.1.2/onvif/device_service';
$username = 'admin';
$password = 'admin';
$client = new ONVIFMedia($wsdl,$service,$username,$password);
try {
$client->response_dump( 'GetProfiles', $client->get_profiles() );
} catch ( Exception $e ) {
print "SOAP error occured\n";
$res = $client->client->__getLastRequest();
print "Last request:\n";
print( $res . "\n" );
$res = $client->client->__getLastResponse();
print "Last response:\n";
print( $res . "\n");
}

?>
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.