本文整理汇总了PHP中SoapClient::executeCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::executeCommand方法的具体用法?PHP SoapClient::executeCommand怎么用?PHP SoapClient::executeCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::executeCommand方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: soap_connect
public static function soap_connect($command)
{
try {
$soap = new SoapClient(NULL, array("location" => "http://" . Loader::load_config("soap_host") . ":" . Loader::load_config("soap_port"), "uri" => "urn:TC", "style" => SOAP_RPC, "login" => Loader::load_config("soap_user"), "password" => Loader::load_config("soap_pass")));
$soap->executeCommand(new SoapParam($command, "command"));
return true;
} catch (Exception $e) {
return false;
}
}
示例2: ExecuteSoapCommand
public function ExecuteSoapCommand($command)
{
try {
$cliente = new SoapClient(NULL, array("location" => $this->settings['syncapp_soap_ip'], "uri" => "urn:TC", "style" => SOAP_RPC, "login" => $this->settings['syncapp_soap_user'], "password" => $this->settings['syncapp_soap_password']));
$result = $cliente->executeCommand(new SoapParam($command, "command"));
} catch (Exception $e) {
return array('sent' => false, 'message' => $e->getMessage());
}
return array('sent' => true, 'message' => $result);
}
示例3: sendSoap
function sendSoap($command, $username, $password, $host, $soapport)
{
$client = new SoapClient(NULL, array("location" => "http://{$host}:{$soapport}/", "uri" => "urn:TC", "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();
}
}
示例4: send
/**
* Send a console command
* @param String $command
* @return Array
*/
public function send($command)
{
$client = new SoapClient(NULL, array("location" => "http://" . $this->config['hostname'] . ":" . $this->config['console_port'], "uri" => "urn:TC", 'login' => $this->config['console_username'], 'password' => $this->config['console_password']));
try {
$result = $client->executeCommand(new SoapParam($command, "command"));
} catch (Exception $e) {
die("Something went wrong! An administrator has been noticed and will send your order as soon as possible.<br /><br /><b>Error:</b> <br />" . $e->getMessage());
}
}
示例5: SoapClient
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* MaNGOSsoap client example
*
* a simple example how to invoke commands using SOAP
*
* Make sure you enabled SOAP in your mangosd.conf!
* SOAP.Enabled = 1
*/
/*
* $username and $password MUST be uppercase
* account $username needs at least SEC_ADMINISTRATOR
*/
$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();
}
示例6: ExecuteSoapCommand
public function ExecuteSoapCommand($command, $realmid)
{
global $realms_config;
try {
$cliente = new SoapClient(NULL, array("location" => "" . $realms_config[$realmid]['soap_protocol'] . "://" . $realms_config[$realmid]['soap_address'] . ":" . $realms_config[$realmid]['soap_port'] . "/", "uri" => "urn:TC", "style" => SOAP_RPC, "login" => $realms_config[$realmid]['soap_user'], "password" => $realms_config[$realmid]['soap_pass']));
$result = $cliente->executeCommand(new SoapParam($command, "command"));
} catch (Exception $e) {
return array('sent' => false, 'message' => $e->getMessage());
}
return array('sent' => true, 'message' => $result);
}
示例7: soap_command
function soap_command()
{
global $soapaddr, $soap_port, $soap_user, $soap_pass, $cmd, $char, $docmd;
require_once 'scripts/config.php';
$cmd = $_GET['cmd'];
$char = $_GET['char'];
$id = $_GET['id'];
$command = "error";
$client = new SoapClient(NULL, array('location' => "http://{$soapaddr}:{$soap_port}/", 'uri' => 'urn:TC', 'login' => $soap_user, 'password' => $soap_pass));
switch ($cmd) {
case "rename":
$command = "character rename {$char}";
break;
case "changefaction":
$command = "character changefaction {$char}";
break;
case "changerace":
$command = "character changerace {$char}";
break;
case "cuztomize":
$command = "character cuztomize {$char}";
break;
default:
$command = "error";
}
if ($command != "error") {
$docmd = $client->executeCommand(new SoapParam($command, "command"));
}
return $docmd;
}
示例8: chose_reward
function chose_reward($reward)
{
global $lang, $core_rev, $remote_access, $DB, $MW, $project;
$getourreward = $DB->select("SELECT `item_id`, `quanity`, `cost`, `quality`, `reward_text` FROM voting_rewards WHERE `id`=?d", $reward);
foreach ($getourreward as $rewardvaluez) {
$itemid = $rewardvaluez['item_id'];
$qty = $rewardvaluez['quanity'];
$cost = $rewardvaluez['cost'];
$quality = $rewardvaluez['quality'];
$rt = $rewardvaluez['reward_text'];
$ch_rewards = array($itemid, $qty, $cost, $quality, $rt);
}
if ($_SESSION["points"] < $ch_rewards[2]) {
echo "<center><font color='red'>Item could not be delivered because the system detects a hack. If you have reached this message in error, please\r\n\t\tcontact your Administrator.</font></center>";
exit;
}
$remote = $remote_access;
if ((int) $MW->getConfig->vote_system->access_type == 1) {
$sleeptimer = (int) $MW->getConfig->vote_system->sleep_timer;
$telnet = @fsockopen($remote[0], $remote[1], $errno, $errstr, 5);
if ($telnet) {
fgets($telnet, 1024);
// Motd
if ($core_rev == 1) {
fputs($telnet, "USER " . $remote[2] . "\n");
} else {
fgets($telnet, 1024);
// USER
fputs($telnet, $remote[2] . "\n");
}
if ($core_rev == 1) {
fputs($telnet, "PASS " . $remote[3] . "\n");
} else {
fgets($telnet, 1024);
// PASS
fputs($telnet, $remote[3] . "\n");
}
sleep($sleeptimer);
$remote_login = fgets($telnet, 1024);
if ($remote_login[0] == "+") {
if ($ch_rewards[0]) {
fputs($telnet, "send items " . $_SESSION["char_name"] . " \"" . $lang["mail_subject"] . "\" \"" . $lang["mail_message"] . "\" " . $ch_rewards[0] . ":" . $ch_rewards[1] . "\n");
} else {
fputs($telnet, "send money " . $_SESSION["char_name"] . " \"" . $lang["mail_subject"] . "\" \"" . $lang["mail_message"] . "\" " . $ch_rewards[1] . "\n");
}
sleep($sleeptimer);
$send_mail = fgets($telnet, 1024);
if (strpos($send_mail, $_SESSION["char_name"])) {
$DB->query("UPDATE `voting_points` SET `points`=(`points` - " . $ch_rewards[2] . "), `points_spent`=(`points_spent` + " . $ch_rewards[2] . ") \r\n\t\t\t\t\tWHERE `id` = " . $_SESSION["user_id"] . " LIMIT 1");
$_SESSION["points"] -= $ch_rewards[2];
$message = "<font color=\"blue\">" . $lang["was_given"] . " " . $ch_rewards[4] . " " . $lang["to"] . " " . $_SESSION["char_name"] . "</font>";
} else {
$message = "<font color=\"red\">Send Mail Problem: " . $send_mail . "</font>";
}
} else {
$message = "<font color=\"red\">Remote Login Problem: " . $remote_login . "</font>";
}
fclose($telnet);
} else {
$message = "<font color=\"red\">Telnet Connection Problem: " . $errstr . "</font>";
}
echo "<center>" . $message . "<br /><br />Click <a href='index.php?n=community&sub=vote'>Here</a> To Return To The Vote System </center><br />";
exit;
} else {
// IF SOAP
if ($ch_rewards[0]) {
$command = "send items " . $_SESSION["char_name"] . " \"" . $lang["mail_subject"] . "\" \"" . $lang["mail_message"] . "\" " . $ch_rewards[0] . ":" . $ch_rewards[1];
} else {
$command = "send money " . $_SESSION["char_name"] . " \"" . $lang["mail_subject"] . "\" \"" . $lang["mail_message"] . "\" " . $ch_rewards[1];
}
if ($project == "mangos") {
$client = new SoapClient(NULL, array("location" => "http://" . $remote[0] . ":" . $remote[1] . "/", "uri" => "urn:MaNGOS", "style" => SOAP_RPC, "login" => $remote[2], "password" => $remote[3]));
} elseif ($project == "trinity") {
$client = new SoapClient(NULL, array("location" => "http://" . $remote[0] . ":" . $remote[1] . "/", "uri" => "urn:TC", "style" => SOAP_RPC, "login" => $remote[2], "password" => $remote[3]));
}
try {
$result = $client->executeCommand(new SoapParam($command, "command"));
$DB->query("UPDATE `voting_points` SET `points`=(`points` - " . $ch_rewards[2] . "), `points_spent`=(`points_spent` + " . $ch_rewards[2] . ") \r\n\t\t\t\t\tWHERE `id` = " . $_SESSION["user_id"] . " LIMIT 1");
$_SESSION["points"] -= $ch_rewards[2];
$message = "<font color='blue'>" . $lang['was_given'] . " " . $ch_rewards[4] . " " . $lang["to"] . " " . $_SESSION["char_name"] . "</font>";
} catch (Exception $e) {
$message = "<font color='darkred'>Send Mail Problem: " . $e->getMessage() . "</font>";
}
echo $message . "<br />";
}
}
示例9: mail_item_donation_ra
//.........这里部分代码省略.........
} else {
fgets($telnet, 1024);
// PASS
fputs($telnet, $remote[3] . "\n");
}
sleep($sleeptimer);
$remote_login = fgets($telnet, 1024);
if ($remote_login[0] == "+") {
echo "Sending Items...<br /><br />";
// If theres anything in the itemsets column, Run the command for each item
if ($itemset != '') {
$qray = $WSDB->select("SELECT entry FROM `item_template` WHERE itemset='" . $itemset . "'");
foreach ($qray as $d) {
$items = $d['entry'];
fputs($telnet, "send items " . $char . " \"" . $lang["mail_subject2"] . "\" \"" . $lang["mail_message2"] . "\" " . $items . ":" . $numb . "\n");
}
// Or, If no itemset, but id is greater then 0 (Gold), Send the item.
} elseif ($itemid > 0) {
$itemz = explode(",", $itemid);
foreach ($itemz as $mitemz) {
$itemids = $mitemz;
fputs($telnet, "send items " . $char . " \"" . $lang["mail_subject2"] . "\" \"" . $lang["mail_message2"] . "\" " . $itemids . ":" . $numb . "\n");
}
} else {
// If Item Is equal to 0, It must be gold.
fputs($telnet, "send money " . $char . " \"" . $lang["mail_subject2"] . "\" \"" . $lang["mail_message2"] . "\" " . $numb . "\n");
}
sleep($sleeptimer);
$send_mail = fgets($telnet, 1024);
if (strpos($send_mail, $char)) {
$message = "<font color=\"blue\">" . $lang["was_given"] . " " . $descr . " " . $lang["to"] . " " . $char . "</font>";
} else {
$message = "<font color=\"red\">Send Mail Problem: " . $send_mail . "</font>";
$error_output++;
}
} else {
$message = "<font color=\"red\">Remote Login Problem: " . $remote_login . "</font>";
$error_output++;
}
fclose($telnet);
} else {
$message = "<font color=\"red\">Telnet Connection Problem: " . $errstr . "</font>";
$error_output++;
}
echo "<center>" . $message . "<br /><br />";
} else {
// IF SOAP
if ($project == "mangos") {
$client = new SoapClient(NULL, array("location" => "http://" . $remote[0] . ":" . $remote[1] . "/", "uri" => "urn:MaNGOS", "style" => SOAP_RPC, "login" => $remote[2], "password" => $remote[3]));
} elseif ($project == "trinity") {
$client = new SoapClient(NULL, array("location" => "http://" . $remote[0] . ":" . $remote[1] . "/", "uri" => "urn:TC", "style" => SOAP_RPC, "login" => $remote[2], "password" => $remote[3]));
}
if ($itemset != '') {
$qray = $WSDB->select("SELECT entry FROM `item_template` WHERE itemset='" . $itemset . "'");
foreach ($qray as $d) {
$items = $d['entry'];
$command = "send items " . $char . " \"" . $lang["mail_subject2"] . "\" \"" . $lang["mail_message2"] . "\" " . $items . ":" . $numb;
try {
$result = $client->executeCommand(new SoapParam($command, "command"));
$message = "<font color='blue'>" . $lang['was_given'] . " " . $items . " " . $lang["to"] . " " . $char . "</font>";
} catch (Exception $e) {
$message = "<font color='darkred'>Send Mail Problem: " . $e->getMessage() . "</font>";
$error_output++;
}
echo $message . "<br />";
}
} elseif ($itemid > 0) {
$itemz = explode(",", $itemid);
foreach ($itemz as $mitemz) {
$itemids = $mitemz;
$command = "send items " . $char . " \"" . $lang["mail_subject2"] . "\" \"" . $lang["mail_message2"] . "\" " . $itemids . ":" . $numb;
try {
$result = $client->executeCommand(new SoapParam($command, "command"));
$message = "<font color='blue'>" . $lang['was_given'] . " " . $itemids . " " . $lang["to"] . " " . $char . "</font>";
} catch (Exception $e) {
$message = "<font color='darkred'>Send Mail Problem: " . $e->getMessage() . "</font>";
$error_output++;
}
echo $message . "<br />";
}
} else {
$command = "send money " . $char . " \"" . $lang["mail_subject2"] . "\" \"" . $lang["mail_message2"] . "\" " . $numb;
try {
$result = $client->executeCommand(new SoapParam($command, "command"));
$message = "<font color='blue'>" . $lang['was_given'] . " " . $numb . " Gold " . $lang["to"] . " " . $char . "</font>";
} catch (Exception $e) {
$message = "<font color='darkred'>Send Mail Problem: " . $e->getMessage() . "</font>";
$error_output++;
}
echo $message . "<br />";
}
}
// Return true if all query's where successful. Else return false
if ($error_output == 0) {
return TRUE;
} else {
return FALSE;
}
exit;
}
示例10: SoapClient
<?php
try {
$conn = new SoapClient(NULL, array('location' => "http://127.0.0.1:7878/", 'uri' => 'urn:TC', 'style' => SOAP_RPC, 'login' => 'soap', 'password' => 'X'));
echo $conn->executeCommand(new SoapParam('server info', 'command'));
} catch (Exception $e) {
print_r($e);
}
示例11: trim
array_push($item_arr, $item_a);
}
if (strpos($chunk, 'ZyID') !== false) {
// Add the item.
$money = trim($line_split[$k + 1]);
}
}
if ($arr_size == count($item_arr) && isset($item)) {
// Array size didn't increase.. Need to add the array item manually.
$item_a = array($item, $item_count, $item_enchant);
array_push($item_arr, $item_a);
}
}
$command = 'account create ' . $account_name . ' ' . $account_pw;
try {
$result = $client->executeCommand(new SoapParam($command, 'command'));
} catch (Exception $e) {
echo 'Account create exception: ', $e->getMessage(), "\n";
return 1;
}
if (!isset($result)) {
echo 'Account creation failed!<br>';
return 1;
}
$command = 'character create ' . $account_name . ' ' . $character_name . ' ' . $character_race . ' ' . $character_class . ' ' . $character_gender . ' ' . $character_skin . ' ' . $character_face . ' ' . $character_hairStyle . ' ' . $character_hairColor . ' ' . $character_facialHair . ' ' . $character_outfitId;
unset($result);
try {
$result = $client->executeCommand(new SoapParam($command, 'command'));
} catch (Exception $e) {
echo 'Character create exception: ', $e->getMessage(), "\n";
return 1;