mardi 25 décembre 2018

Bitnami LAMP Laravel : Object reference not set to an instance of an object

I am using Bitnami LAMP 7.1.24 and Laravel in Azure, The SMS Gateway link is here, the script is running in both AWS and Localhost (without Bitnami) using SoapClient but the same script not running in Azure Ubuntu using Bitnami, local and AWS using php 7.0.32. the SMS gateway returns the above error message.

Note : Soap Client enabled in Azure LAMP.

I can contact the SMS provider but my question is the same script runs in localhost but why not from Bitnami?, Is Soap Client generates the correct object to the SMS Gateway?

Sample code :

$otp_number = random_int(100000, 999999);
$params = array(
        'userID' => config('constants.sms_user_id'),
        'password' => config('constants.sms_password'),
        'fromNumber' => config('constants.sms_from_number'),
        'toNumber' => $input['phoneNumber'],
        'reference' => config('constants.sms_reference'),
        'text' => 'Use '.$otp_number.'. Valid for 15min.',
        'delayDeliveryMinutes' => 0
);

$wsdl = 'http://www.pulseem.co.il/Pulseem/PulseemSendServices.asmx?wsdl';
$client = new SoapClient($wsdl);
$result = $client->SendSingleSMS($params);
$res = $result->SendSingleSMSResult;
if($res == 'Success'){
    return Otp::createOtp($input);
}else{
    \Log::info(array("otp error"=>$res));
    return array("resultCode"=>1, "resultInfo"=>"", "resultMessage"=>"OTP not sent, Check your mobile number or try later");
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire