mirror of
https://github.com/alexkulya/pandaria_5.4.8.git
synced 2025-12-12 19:37:04 +00:00
34 lines
662 B
PHP
34 lines
662 B
PHP
<?php
|
|
/*
|
|
* OCSoap client example
|
|
*
|
|
* a simple example how to invoke commands using SOAP
|
|
*/
|
|
|
|
$username = 'ADMINISTRATOR';
|
|
$password = 'ADMINISTRATOR';
|
|
$host = "localhost";
|
|
$soapport = 7878;
|
|
$command = "server info";
|
|
|
|
$client = new SoapClient(NULL,
|
|
array(
|
|
"location" => "http://$host:$soapport/",
|
|
"uri" => "urn:Oregon",
|
|
"style" => SOAP_RPC,
|
|
'login' => $username,
|
|
'password' => $password
|
|
));
|
|
|
|
try {
|
|
$result = $client->executeCommand(new SoapParam($command, "command"));
|
|
|
|
echo "Command succeeded! Output:<br />\n";
|
|
echo $result;
|
|
}
|
|
catch (Exception $e)
|
|
{
|
|
echo "Command failed! Reason:<br />\n";
|
|
echo $e->getMessage();
|
|
}
|
|
?>
|