Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyFire committed Nov 27, 2012
2 parents c92f8a2 + fbd338e commit 099ce38
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions contrib/PHP/soap/example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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();
}
?>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 099ce38

Please sign in to comment.