I am learning Yii and i am trying to create a web servicethis is my WebServiceForUserController.php

public function actions() { return array( 'databaseServices'=>array( 'class'=> 'CWebServiceAction', // 'serviceVar'=>'serviceIs' ) ); } /** * * @return dateTime it returns the current timestamp of the server * @soap */ public function serverTimestamp() { $query= 'Select NOW()'; $timestamp=Yii::app()->db->createCommand($query)->queryScalar(); return $timestamp; } /* * this is to consume the ServerTimestamp web service * */ public function actionFindTimestamp() { ini_set ( 'soap.wsdl_cache_enable' , 0 ); ini_set ( 'soap.wsdl_cache_ttl' , 0 ); $myclient=new SoapClient('http://localhost/project/index.php/webServicesForUser/databaseServices'); $timestampResult=$myclient->serverTimestamp(); echo $timestampResult; }But its throwing me error

Error 500Bad RequestI have checked the URL many times but its still throwing me the error. How can i resolve it?


Check Solution