SOAP sample count

Source

$client = new SoapClient('http://tnodb.obs-besancon.fr/ws/ws_bdp.wsdl');
if ($client->getAvailability()) {



	echo "Number of orbits by surveys :\n";
	$datas = $client->getNumberOf(
		'orbit',       // We count orbits
		'',            // We don't have any cookie
		array(),       // All records (no criterias)
		'survey'       // We want the count surveys
	);
	var_dump($datas);
	echo "\n\n";



	echo "Same but using orbitABG :\n";
	$datas = $client->getNumberOf(
		'orbitABG',    // We count orbits
		'',            // We don't have any cookie
		array(),       // All records (no criterias)
		'survey'       // We want the count surveys
	);
	var_dump($datas);
	echo "\n\n";



	echo "Total number of runs in 2004 :\n";
	$datas = $client->getNumberOf(
		'run',         // We count runs
		'',            // We don't have any cookie
		array('run'=>'2004%'), // Run name staring by 2004
		''             // Count all runs
	);
	var_dump($datas);
	echo "\n\n";


} else {
	echo 'Database is temporarily unavailable';
}

Result

Number of orbits by surveys :
array(7) {
  ["CFEPS"]=>
  string(3) "179"
  ["HiLat"]=>
  string(2) "14"
  ["MA"]=>
  string(2) "77"
  ["NONE"]=>
  string(2) "21"
  ["NONE,CFEPS"]=>
  string(1) "4"
  ["NONE,HiLat"]=>
  string(1) "7"
  ["OSSOS"]=>
  string(2) "85"
}


Same but using orbitABG :
array(7) {
  ["CFEPS"]=>
  string(3) "179"
  ["HiLat"]=>
  string(2) "14"
  ["MA"]=>
  string(2) "77"
  ["NONE"]=>
  string(2) "21"
  ["NONE,CFEPS"]=>
  string(1) "4"
  ["NONE,HiLat"]=>
  string(1) "7"
  ["OSSOS"]=>
  string(2) "85"
}


Total number of runs in 2004 :
array(1) {
  [""]=>
  string(2) "26"
}


Back to documentation