chenkelang90120 2012-10-23 10:25:34 2747次浏览 0条回复 0 0 0

这一块是服务器端的代码

class TestController extends Controller { 
    public function actions()
    {
        return array(
            'quote'=>array(
                'class'=>'CWebServiceAction',
            ),
        );
    }
    public function getPrice($symbol)
    {
        $prices=array('IBM'=>100, 'GOOGLE'=>350);
        return isset($prices[$symbol])?$prices[$symbol]:0;
    }	
}

这一块是客户端的代码

$client=new SoapClient('http://localhost/newfenxiao/index.php?r=test/quote');
echo $client->getPrice('GOOGLE');

基本上是参照官网上来做的,可以我这边出现这样一个问题,访问客户端的时候: Function ("getPrice") is not a valid method for this service 不知道我的问题是出在那里?

    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册