本文整理汇总了PHP中SoapClient::SendSms方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::SendSms方法的具体用法?PHP SoapClient::SendSms怎么用?PHP SoapClient::SendSms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::SendSms方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SendSMS
public function SendSMS()
{
// Check credit for the gateway
if (!$this->GetCredit()) {
return;
}
try {
$client = new SoapClient($this->wsdl_link);
$parameters['username'] = $this->username;
$parameters['password'] = $this->password;
$parameters['from'] = $this->from;
$parameters['to'] = $this->to;
$parameters['text'] = $this->msg;
$parameters['isflash'] = $this->isflash;
$parameters['udh'] = "";
$parameters['recId'] = array(0);
$parameters['status'] = 0x0;
$return = '';
$return .= $client->SendSms($parameters)->SendSmsResult;
$return .= $status;
$this->InsertToDB($this->from, $this->msg, $this->to);
$this->Hook('wp_sms_send', $result);
return $return;
} catch (SoapFault $ex) {
return $ex->faultstring;
}
}
示例2: SendSms
function SendSms($textMessage, $toNumber)
{
// turn off the WSDL cache
ini_set("soap.wsdl_cache_enabled", "0");
try {
$user = sms_config::$username;
$pass = sms_config::$password;
$client = new SoapClient(sms_config::$send_server);
$getcredit_parameters = array("username" => $user, "password" => $pass);
$credit = $client->GetCredit($getcredit_parameters)->GetCreditResult;
echo "Credit: " . $credit . "<br />";
$encoding = "UTF-8";
//CP1256, CP1252
$textMessage = iconv($encoding, 'UTF-8//TRANSLIT', $textMessage);
$sendsms_parameters = array('username' => $user, 'password' => $pass, 'from' => "50001333837392", 'to' => array($toNumber), 'text' => $textMessage, 'isflash' => false, 'udh' => "", 'recId' => array(0), 'status' => 0);
$status = $client->SendSms($sendsms_parameters)->SendSmsResult;
echo "Status: " . $status . "<br />";
$getnewmessage_parameters = array("username" => $user, "password" => $pass, "from" => "50001333837392");
$incomingMessagesClient = new SoapClient(sms_config::$receive_server);
$res = $incomingMessagesClient->GetNewMessagesList($getnewmessage_parameters);
print_r($res);
echo "<table border=1>";
echo "<th>MsgID</th><th>MsgType</th><th>Body</th><th>SendDate</th><th>Sender</th><th>Receiver</th><th>Parts</th><th>IsRead</th>";
foreach ($res->GetNewMessagesAResult->Message as $row) {
echo "<tr>" . "<td>" . $row->MsgID . "</td>" . "<td>" . $row->MsgType . "</td>" . "<td>" . $row->Body . "</td>" . "<td>" . $row->SendDate . "</td>" . "<td>" . $row->Sender . "</td>" . "<td>" . $row->Receiver . "</td>" . "<td>" . $row->Parts . "</td>" . "<td>" . $row->IsRead . "</td>" . "</tr>";
}
echo "</table>";
} catch (SoapFault $ex) {
echo $ex->faultstring;
}
}
示例3: SendSMS
public function SendSMS()
{
$client = new SoapClient($this->wsdl_link);
$result = $client->SendSms(array('username' => $this->username, 'password' => $this->password, 'from' => $this->from, 'to' => $this->to, 'text' => $this->msg, 'flash' => false, 'udh' => ''));
if ($result) {
$this->InsertToDB($this->from, $this->msg, $this->to);
$this->Hook('wp_sms_send', $result);
}
return $result;
}
示例4: SendSMS
public function SendSMS()
{
// Check credit for the gateway
if (!$this->GetCredit()) {
return;
}
/**
* Modify sender number
*
* @since 3.4
* @param string $this->from sender number.
*/
$this->from = apply_filters('wp_sms_from', $this->from);
/**
* Modify Receiver number
*
* @since 3.4
* @param array $this->to receiver number
*/
$this->to = apply_filters('wp_sms_to', $this->to);
/**
* Modify text message
*
* @since 3.4
* @param string $this->msg text message.
*/
$this->msg = apply_filters('wp_sms_msg', $this->msg);
try {
$client = new SoapClient($this->wsdl_link);
$parameters['username'] = $this->username;
$parameters['password'] = $this->password;
$parameters['from'] = $this->from;
$parameters['to'] = $this->to;
$parameters['text'] = $this->msg;
$parameters['isflash'] = $this->isflash;
$parameters['udh'] = "";
$parameters['recId'] = array(0);
$parameters['status'] = 0x0;
$result = '';
$result .= $client->SendSms($parameters)->SendSmsResult;
$result .= $status;
$this->InsertToDB($this->from, $this->msg, $this->to);
/**
* Run hook after send sms.
*
* @since 2.4
* @param string $result result output.
*/
do_action('wp_sms_send', $result);
return $result;
} catch (SoapFault $ex) {
return $ex->faultstring;
}
}
示例5: SendSMS
public function SendSMS()
{
// Check credit for the gateway
if (!$this->GetCredit()) {
return;
}
$client = new SoapClient($this->wsdl_link);
$result = $client->SendSms(array('username' => $this->username, 'password' => $this->password, 'from' => $this->from, 'to' => $this->to, 'text' => $this->msg, 'flash' => false, 'udh' => ''));
if ($result) {
$this->InsertToDB($this->from, $this->msg, $this->to);
$this->Hook('wp_sms_send', $result);
return $result;
}
return false;
}
示例6: sendSanaPayamakWS
function sendSanaPayamakWS()
{
$response = false;
ini_set("soap.wsdl_cache_enabled", "0");
try {
$client = new SoapClient('http://panel.sanapayamak.com/post/send.asmx?WSDL');
$parameters = array('username' => $this->_username, 'password' => $this->_password, 'from' => $this->_from, 'to' => array('string' => $this->_to), 'text' => $this->_body, 'isflash' => $this->_flash, 'udh' => "", 'recId' => array(0), 'status' => 0x0);
$SendSmsResult = $client->SendSms($parameters)->SendSmsResult;
} catch (SoapFault $ex) {
echo $ex->faultstring;
}
if ($SendSmsResult == "1") {
$response = true;
}
return $response;
}
示例7: SendSMS
public function SendSMS()
{
$client = new SoapClient($this->wsdl_link);
$parameters['username'] = $this->username;
$parameters['password'] = $this->password;
$parameters['from'] = $this->from;
$parameters['to'] = $this->to;
$parameters['text'] = $this->msg;
$parameters['isflash'] = false;
$parameters['udh'] = "";
$parameters['recId'] = array(0);
$parameters['status'] = 0x0;
$result = $client->SendSms($parameters);
if ($result) {
$this->InsertToDB($this->from, $this->msg, $this->to);
$this->Hook('wp_sms_send', $result);
}
return $result;
}
示例8: SendSMS
public function SendSMS()
{
// Check credit for the gateway
if (!$this->GetCredit()) {
return;
}
/**
* Modify sender number
*
* @since 3.4
* @param string $this->from sender number.
*/
$this->from = apply_filters('wp_sms_from', $this->from);
/**
* Modify Receiver number
*
* @since 3.4
* @param array $this->to receiver number
*/
$this->to = apply_filters('wp_sms_to', $this->to);
/**
* Modify text message
*
* @since 3.4
* @param string $this->msg text message.
*/
$this->msg = apply_filters('wp_sms_msg', $this->msg);
$client = new SoapClient($this->wsdl_link);
$result = $client->SendSms(array('username' => $this->username, 'password' => $this->password, 'from' => $this->from, 'to' => $this->to, 'text' => $this->msg, 'flash' => false, 'udh' => ''));
if ($result) {
$this->InsertToDB($this->from, $this->msg, $this->to);
/**
* Run hook after send sms.
*
* @since 2.4
* @param string $result result output.
*/
do_action('wp_sms_send', $result);
return $result;
}
return false;
}
示例9: SendSMS
public function SendSMS()
{
try {
$client = new SoapClient($this->wsdl_link);
$parameters['username'] = $this->username;
$parameters['password'] = $this->password;
$parameters['from'] = $this->from;
$parameters['to'] = $this->to;
$parameters['text'] = $this->msg;
$parameters['isflash'] = $this->isflash;
$parameters['udh'] = "";
$parameters['recId'] = array(0);
$parameters['status'] = 0x0;
$this->InsertToDB($this->from, $this->msg, $this->to);
$this->Hook('wp_sms_send', $result);
return $client->SendSms($parameters)->SendSmsResult;
} catch (SoapFault $ex) {
echo $ex->faultstring;
}
}
示例10: m_addObject
public function m_addObject($to, $message, $show = true)
{
global $settings, $lang, $system;
set_time_limit(600);
// $show = true;
$time = time();
// $to = $to . $settings['adminMobile'];
$to = strstr($to, ',') ? explode(',', $to) : array($to);
if ($settings[proto] == "REST") {
$encoding = mb_detect_encoding($message) == 'ASCII' ? "1" : "8";
$send = $this->SendREST($settings[userName], $settings[password], $settings['from'], $to, $message, $encoding);
if ($send) {
foreach ($to as $t) {
$system->dbm->db->insert("`{$settings['smsObject']}`", "`active`, `timeStamp`, `owner`, `group`, `or`, `ow`, `ox`, `gr`, `gx`, `from`, `to`, `message`", "1, {$time}, 1, 1, 1, 1, 1, 1, 1, '{$settings['from']}', '{$t}', '{$message}'");
}
if ($show) {
$system->watchDog->exception("s", $lang[messageSend], sprintf($lang[successfulDone], $lang[messageSend], strstr($message, ' ', true)));
}
} else {
if ($show) {
$system->watchDog->exception("e", $lang[error], '2');
}
}
} elseif ($settings[proto] == "SOAP") {
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient($settings[url], array('encoding' => 'UTF-8'));
$parameters['username'] = $settings[userName];
$parameters['password'] = $settings[password];
$parameters['from'] = $settings['from'];
$parameters['to'] = $to;
$parameters['text'] = $message;
$parameters['isflash'] = false;
$parameters['udh'] = "";
$parameters['recId'] = array(0);
$parameters['status'] = 0x0;
switch ($client->SendSms($parameters)->SendSmsResult) {
case 0:
$system->watchDog->exception("e", $lang[error] . '0', 'نام كاربري يا رمز عبور صحيح نمي باشد');
break;
case 1:
foreach ($to as $t) {
$system->dbm->db->insert("`{$settings['smsObject']}`", "`active`, `timeStamp`, `owner`, `group`, `or`, `ow`, `ox`, `gr`, `gx`, `from`, `to`, `message`", "1, {$time}, 1, 1, 1, 1, 1, 1, 1, '{$settings['from']}', '{$t}', '{$message}'");
}
if ($show) {
$system->watchDog->exception("s", $lang[messageSend], sprintf($lang[successfulDone], $lang[messageSend], $message));
}
break;
case 2:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '2', 'اعتبار كافي نيست');
}
break;
case 3:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '3', 'محدوديت در ارسال روزانه');
}
break;
case 4:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '4', 'محدوديت در حجم ارسال');
}
break;
case 5:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '5', 'شماره فرستنده معتبر نيست');
}
break;
case 6:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '6', 'سامانه در حال بروز رساني مي باشد');
}
break;
case 7:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '7', 'متن پيامك شامل كلمات فيلتر شده مي باشد');
}
break;
case 8:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '8', 'عدم رسيدن به حداقل ارسال');
}
break;
case 9:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '9', 'ارسال از خطوط عمومي از طريق وب سرويس امكان پذير نمي باشد');
}
break;
case 10:
if ($show) {
$system->watchDog->exception("e", $lang[error] . '10', 'كاربر مسدود شده است');
}
break;
default:
if ($show) {
$system->watchDog->exception("e", $lang[error], $lang['unknown'] . $lang[error]);
}
break;
}
} else {
$system->watchDog->exception("e", $lang[error], 'Protochol not set');
//.........这里部分代码省略.........