<?php

class WSController extends CController
{
  public static function getUrlForClient()
  {
    return absoluteUrl('index.php').'?r=ws/do';
  }
  
  public function actions()
  {
    return array(
        'do'=>array(
            'class'=>'CWebServiceAction',
        ),
    );
  }
  
  /**
   * get the server time
   * @return string
   */
  public function getServerTime()
  {
    return DateTimeEx::nows();
  }
  
  public function actionindex()
  {
    $client=new SoapClient(self::getUrlForClient());
    echo $client->getServerTime();
  }
}