<?php

include_once("../inc/ini.inc.php");
include_once("get_opt.class.php");
define('WSDL_EXCHANGE', 'http://localhost/adis-geo/?WSDL');

echo "Адрес описания сервиса: ". WSDL_EXCHANGE."<br>\n";
try {
	$soap = new SoapClient(WSDL_EXCHANGE, array(
				"trace" => 1,
				"soap_version"=> "1.1",
				'encoding'=>'utf-8',
				'exceptions' => true,
				'cache_wsdl'=>WSDL_CACHE_NONE
				)
			);
	//print_r($soap);
	testPrint($soap, 1);
} catch (Exception $e) {
	echo 'Ошибка: '.$e->getMessage()."\n";
	print_r($e);
}


function writeRequestResponse(&$soap, $res){
	print_r($soap->__getLastRequest());
	echo "\n";
	print_r($soap->__getLastResponse());
	print_r($res);
	echo "\n";
}

function testPrint(&$soap, $type = 0){
	if ($type) {
		echo "\nСписок доступных методов:\n<pre>";
		print_r($soap->__getFunctions());
		echo "</pre>\nСписок доступных типов данных:\n<pre>";
		print_r($soap->__getTypes());
		echo "</pre>";
	}


	$coord = new stdClass();
	$coord->ObjectID = "87126381";
	$coord->time = date("c");

	$coord->lat = "53.215783";
	$coord->lon = "56.873844";

	$other = $soap->PutCoord($coord);
	writeRequestResponse($soap, $other);


}

?>

