I am really sticky on this problem :
here is a php server side code , i wanna do a web service , the client is java script , i wrote it in php client and it worked ,, i tried many times to make client java script to call the web service from the php server according to the yii framework , can any body give me a java script code to handle this web service in the php code down (ther is just one service getSMS) , and if any body wanna the script code to check where the error is , i will send it to him:
** <?php
ini_set ('soap.wsdl_cache_enabled',0);
class WebservicesController extends Controller
{
/**
* @var string the default layout for the views.
Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'.
*/
/**
* @return array action filters
*/
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules()
{
return
array('allow',
'actions'=>array('quote'),
'user'=>array('*'),);
}
public function actions()
{
return array(
'quote'=>array(
'class'=>'CWebServiceAction',
'classMap'=>array(
'Sms'=>'Sms',
)
),
);
}
/**
//
* @return string
* @soap
*/
public function getSMS()
{
$user = Yii::app()->db->createCommand()
->select('text')
->from('sms')
->queryall();
return json_encode($user);
}
}
class webservices extends CActiveRecord
{
/**
* @var integer post ID
* @soap
*/
public $id;
/**
* @var string post title
* @soap
*/
public $title;
public static function model($className=__CLASS__)
{
return parent::model($className);
}
}
?>