script client code to php webservice -
i sticky on problem :
here php server side code , wanna web service , client java script , wrote in php client , worked ,, tried many times make client java script call web service php server according yii framework , can body give me java script code handle web service in php code down (ther 1 service getsms) , , if body wanna script code check error , send him:
** <?php ini_set ('soap.wsdl_cache_enabled',0); class webservicescontroller extends controller { /** * @var string default layout views. defaults '//layouts/column2', meaning * using two-column layout. see 'protected/views/layouts/column2.php'. */ /** * @return array action filters */ /** * specifies access control rules. * method used '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); } } ?>
Comments
Post a Comment