Example #1
0
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;
    }
}
Example #2
0
 public function GetCredit()
 {
     try {
         $client = new SoapClient($this->wsdl_link);
         return $client->GetCredit(array("username" => $this->username, "password" => $this->password))->GetCreditResult;
     } catch (SoapFault $ex) {
         return $ex->faultstring;
     }
 }
Example #3
0
 public function GetCredit()
 {
     if (!$this->username and !$this->password) {
         return false;
     }
     $client = new SoapClient($this->wsdl_link);
     $result = $client->GetCredit($this->username, $this->password);
     return $this->_xml_extract("messages", $result);
 }
Example #4
0
 public function GetCredit()
 {
     if (!$this->username and !$this->password) {
         return;
     }
     $client = new SoapClient($this->wsdl_link);
     $result = $client->GetCredit(array('userName' => $this->username, 'password' => $this->password));
     return $result->GetCreditResult;
 }
Example #5
0
 public function GetCredit()
 {
     try {
         $client = new SoapClient($this->wsdl_link_credit);
         $parameters = array('signature' => $this->username);
         $responseSTD = (array) $client->GetCredit($parameters);
         return $responseSTD['GetCreditResult'];
     } catch (SoapFault $ex) {
         echo $ex->faultstring;
     }
 }
Example #6
0
 public function GetCredit()
 {
     $client = new SoapClient($this->wsdl_link);
     $result = $client->GetCredit(array('AcountID' => $this->password));
     return $result->GetCreditResult;
 }
 public function GetCredit()
 {
     $client = new SoapClient($this->wsdl_link);
     if ($client->Authentication($this->username, $this->password) == '1') {
         return $client->GetCredit();
     } else {
         return false;
     }
 }