i have a problem with soap class in php. i have write a code to send sms via a sms panel. these codes run correctly on localhost (when run codes by xampp on my pc) but this code don’t work when i run them on server. the php versions are same on both of them (localhost and xampp)
<?php
$FORM="30005966371";
$USERNAME="xxxx";
$PASSWORD="12345";
$DOMAIN="0098";
//---- variables ----
$TO="0935xxxxxxx";
$TEXT="test msg";
//-------------------
ini_set("soap.wsdl_cache_enabled", "0");
$sms_client = new SoapClient('http://webservice.0098sms.com/service.asmx?wsdl',array('encoding'=>'UTF-8'));
$parameters['username'] = $USERNAME;
$parameters['password'] = $PASSWORD;
$parameters['mobileno'] = $TO;
$parameters['pnlno'] = $FORM;
$parameters['text']=$TEXT;
$parameters['isflash'] =false;
echo $sms_client->SendSMS($parameters)->SendSMSResult;
?>
when i run above codes on localhost the message sends correctly but when run this code on server the following error returns:
bimehco.ir is currently unable to handle this request.
HTTP ERROR 500
i enabled soap extension in php.ini file on server but it still dont work correctly.
2
Answers
my soap codes were true and don't have any problem. it was a problem on host. you can use above codes for soap. or you can use curve function instead.
The initialization of the
SoapClient
class should look as follows when searching for errors.