this below code is my PHP solution to use SOAP and work fine, now i want to implementing that on NodeJs, but i can't and after opening url with /sendsms i dont get any result. this soap is for send sms, after get empty result, i dont get any sms from that
public static function SendREST($useame, $password, $Source, $Destination, $MsgBody, $Encoding)
{
$URL = "http://URL/sendsms";
$msg = urlencode(trim($MsgBody));
$url = $URL . '?useame=' . $useame . '&password=' . $password . '&source=' . $Source . '&destination=' . $Destination . '&message=' . $msg;
$headers[] = 'Accept: text/html';
$headers[] = 'Coection: Keep-Alive';
$headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
$process = curl_init($url);
curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
curl_setopt($process, CURLOPT_HEADER, 0);
curl_setopt($process, CURLOPT_TIMEOUT, 30);
curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
retu curl_exec($process);
try {
$retu = curl_exec($process);
if ($retu) {
retu true;
}
} catch (Exception $ex) {
retu false;
}
}
My NodeJs solution:
var soap = require('soap');
var url = 'http://URL/sendsms';
var args = {useame: '5280',password:'3310AZa',source:'08888735280',destination:'97823036569',message:'SHOOOOOOT !!'};
app.get('/sendsms', function (req, res) {
soap.createClient(url, function (err, client) {
});
});
