server/contrib/soap/example.php
arrai e520d8409e [9466] Implemented SOAP in MaNGOS
- removed deprecated code from RASocket
- allow more than one login at a time on the RA console
- added gsoap library for handling SOAP requests
- removed deprecated mangos_string entry

Thanks to:
- Derex for reporting a bug which occured if more than 1024
    players were connected  [poll() vs select()]
- caeruleaus for adding windowsbuild support
- vladimir for suggesting a different thread starting order
- fdb_ for suggesting SOAP in the first place
2010-02-27 10:52:07 +01:00

34 lines
666 B
PHP

<?php
/*
* MaNGOSsoap 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:MaNGOS",
"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();
}
?>