本文整理汇总了PHP中SoapClient::client_get方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::client_get方法的具体用法?PHP SoapClient::client_get怎么用?PHP SoapClient::client_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::client_get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SoapClient
<?php
require 'soap_config.php';
$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1));
try {
if ($session_id = $client->login($username, $password)) {
echo 'Logged successfull. Session ID:' . $session_id . '<br />';
}
//* Parameters
$reseller_id = 1;
$c_id = 1;
//* Get the client record
$client_record = $client->client_get($session_id, $reseller_id);
//* Change parameters
$client_record['country'] = 'de';
$client_record['username'] = 'mguy';
$client_record['contact_name'] = 'brush';
$affected_rows = $client->client_update($session_id, $c_id, $reseller_id, $client_record);
echo "Number of records that have been changed in the database: " . $affected_rows . "<br>";
if ($client->logout($session_id)) {
echo 'Logged out.<br />';
}
} catch (SoapFault $e) {
echo $client->__getLastResponse();
die('SOAP Error: ' . $e->getMessage());
}
示例2: ispcfg3_UnsuspendAccount
function ispcfg3_UnsuspendAccount($params)
{
$username = $params['username'];
$password = $params['password'];
$domain = strtolower($params['domain']);
$clientsdetails = $params['clientsdetails'];
$soapuser = $params['configoption1'];
$soappassword = $params['configoption2'];
$soapsvrurl = $params['configoption3'];
$soapsvrssl = $params['configoption4'];
$webcreation = $params['configoption9'];
$dns = $params['configoption18'];
$addmaildomain = $params['configoption21'];
$addftpuser = $params['configoption22'];
if ($soapsvrssl == 'on') {
$soap_url = 'https://' . $soapsvrurl . '/remote/index.php';
$soap_uri = 'https://' . $soapsvrurl . '/remote/';
} else {
$soap_url = 'http://' . $soapsvrurl . '/remote/index.php';
$soap_uri = 'http://' . $soapsvrurl . '/remote/';
}
if (isset($username) && $username != '' && (isset($password) && $password != '')) {
try {
/* Connect to SOAP Server */
$client = new SoapClient(null, array('location' => $soap_url, 'uri' => $soap_uri, 'exceptions' => 1, 'trace' => false));
/* Authenticate with the SOAP Server */
$session_id = $client->login($soapuser, $soappassword);
$result_id = $client->client_get_by_username($session_id, $username);
$sys_userid = $result_id['client_id'];
$sys_groupid = $result_id['groups'];
$client_detail = $client->client_get($session_id, $sys_userid);
$parent_client_id = $client_detail['parent_client_id'];
$domain_id = $client->dns_zone_get_by_user($session_id, $sys_userid, $client_detail['default_dnsserver']);
if ($webcreation == 'on') {
$clientsites = $client->client_get_sites_by_user($session_id, $sys_userid, $sys_groupid);
$i = 0;
$j = 1;
while ($j <= count($clientsites)) {
$domainres = $client->sites_web_domain_set_status($session_id, $clientsites[$i]['domain_id'], 'active');
logModuleCall('ispconfig', 'UnSuspend Web Domain', $clientsites[$i]['domain_id'], $domainres, '', '');
$i++;
$j++;
}
}
if ($addftpuser == 'on') {
$ftpclient = $client->sites_ftp_user_get($session_id, array('username' => $username . '%'));
$i = 0;
$j = 1;
while ($j <= count($ftpclient)) {
$ftpclient[$i]['active'] = 'y';
$ftpclient[$i]['password'] = '';
$ftpid = $client->sites_ftp_user_update($session_id, $sys_userid, $ftpclient[$i]['ftp_user_id'], $ftpclient[$i]);
logModuleCall('ispconfig', 'UnSuspend Ftp User', $ftpclient[$i]['ftp_user_id'], $ftpclient[$i], '', '');
$i++;
$j++;
}
}
if ($addmaildomain == 'on') {
$emaildomain = $client->mail_domain_get_by_domain($session_id, $domain);
$mailid = $client->mail_domain_set_status($session_id, $emaildomain[0]['domain_id'], 'active');
logModuleCall('ispconfig', 'UnSuspend Email Domain', $emaildomain[0]['domain_id'], $mailid, '', '');
}
if ($dns == 'on') {
$i = 0;
$j = 1;
while ($j <= count($domain_id)) {
$affected_rows = $client->dns_zone_set_status($session_id, $domain_id[$i]['id'], 'active');
$i++;
$j++;
logModuleCall('ispconfig', 'UnSuspend Domain', $domain_id[$i]['id'], $affected_rows, '', '');
}
}
$client_detail['locked'] = 'n';
$client_detail['password'] = '';
$client_result = $client->client_update($session_id, $sys_userid, $parent_client_id, $client_detail);
logModuleCall('ispconfig', 'UnSuspend Client', $sys_userid . ' ' . $sys_groupid, $client_result, '', '');
if ($client->logout($session_id)) {
}
$successful = '1';
} catch (SoapFault $e) {
$error = 'SOAP Error: ' . $e->getMessage();
$successful = '0';
}
if ($successful == 1) {
$result = 'success';
} else {
$result = 'Error: ' . $error;
}
} else {
/*
* No username or password set.
*/
$result = 'Username or Password is Blank or Not Set';
}
return $result;
}
示例3: SoapClient
<?php
require 'soap_config.php';
$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1));
try {
if ($session_id = $client->login($username, $password)) {
echo 'Logged successfull. Session ID:' . $session_id . '<br />';
}
//* Parameters
$reseller_id = 1;
$client_id = 1;
//* Get the client record
$client_record = $client->client_get($session_id, $client_id);
//* Change parameters
$client_record['country'] = 'de';
$client_record['username'] = 'mguy';
$client_record['contact_name'] = 'brush';
//* We set the client password to a empty string as we do not want to change it.
$client_record['password'] = '';
$affected_rows = $client->client_update($session_id, $c_id, $reseller_id, $client_record);
echo "Number of records that have been changed in the database: " . $affected_rows . "<br>";
if ($client->logout($session_id)) {
echo 'Logged out.<br />';
}
} catch (SoapFault $e) {
echo $client->__getLastResponse();
die('SOAP Error: ' . $e->getMessage());
}
示例4: getClient
/**
* Returns the client.
*
* @return IspData\Client
*/
public function getClient($clientId)
{
$data = $this->server->client_get($this->sessionId, $clientId);
return Data\Client::fromData($data);
}