Here’s a working example of Grameen Phone’s AloAshbei Platform.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
<?php /* * Demo of the SMS API * Author: maSnun * URL: https://masnun.com */ // I hosted the WSDL on my own host $soap = new SoapClient("https://masnun.com/wsdl/wsdl.php"); // Set the parameters in an array $a['registrationID'] = "masnun"; $a['password'] = "******"; $a['sourceMsisdn'] = '8801711960803'; $a['destinationMsisdn'] = '88017********'; $a['smsPort'] = 7424; $a['msgType'] = 4; $a['charge'] = 2.00 ; $a['chargedParty'] = '8801711960803'; $a['contentArea'] = 'gpgp_psms'; $a['msgContent'] = 'Hello GP API!'; try { var_dump( $soap->sendSMS( array ("SendSMSRequest" => $a) ) ); } catch (Exception $e) { var_dump($e->getMessage()); } ?> |
Example Response:
1 2 3 4 5 6 7 8 9 10 11 12 |
masnun@ubuntu:~$ cd random masnun@ubuntu:~/random$ php gpsoap.php object(stdClass)#2 (1) { ["SendSMSResponse"]=> object(stdClass)#3 (2) { ["status"]=> string(2) "OK" ["msgID"]=> string(17) "20100204183047653" } } masnun@ubuntu:~/random$ |