Advertisement
Guest User

Untitled

a guest
Jul 31st, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. public static function SendREST($username, $password, $Source, $Destination, $MsgBody, $Encoding)
  2. {
  3. $URL = "http://URL/sendsms";
  4. $msg = urlencode(trim($MsgBody));
  5. $url = $URL . '?username=' . $username . '&password=' . $password . '&source=' . $Source . '&destination=' . $Destination . '&message=' . $msg;
  6.  
  7. $headers[] = 'Accept: text/html';
  8. $headers[] = 'Connection: Keep-Alive';
  9. $headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
  10. $process = curl_init($url);
  11.  
  12. curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
  13. curl_setopt($process, CURLOPT_HEADER, 0);
  14. curl_setopt($process, CURLOPT_TIMEOUT, 30);
  15. curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
  16. curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
  17.  
  18. return curl_exec($process);
  19.  
  20. try {
  21. $return = curl_exec($process);
  22. if ($return) {
  23. return true;
  24. }
  25. } catch (Exception $ex) {
  26. return false;
  27. }
  28. }
  29.  
  30. var soap = require('soap');
  31. var url = 'http://URL/sendsms';
  32. var args = {username: '5280',password:'3310AZa',source:'08888735280',destination:'97823036569',message:'SHOOOOOOT !!'};
  33.  
  34. app.get('/sendsms', function (req, res) {
  35. soap.createClient(url, function (err, client) {
  36. });
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement