dt2015 2013-12-07 08:15
浏览 79
已采纳

Wsdl方法不通过SoapClient调用,服务器是在YII中创建的

i have create yii framework based wsdl service:

from the link :- http://www.yiiframework.com/doc/guide/1.1/en/topics.webservice

and facing the issues that is their in the comment

http://www.yiiframework.com/doc/guide/1.1/en/topics.webservice#c6656

and server create fine as i am able to see the wsdl file

but when i try to access the method by the code from external file not in yii site folder

below file is inside another folder not in mysite_yii folder hope that not create any issue as it has to call the wsdl file

$client=new SoapClient('http://localhost/mysite_yii/index.php?r=stock/quote');

try
{
echo $client->getPrice('GOOGLE');
}
catch(Exception $e)
{
    echo "<pre>";
    print_r($e);

}

i am getting the following exception

  SoapFault Object
(
    [message:protected] => Function ("getPrice") is not a valid method for this service
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /var/www/serverclient/stock.php
    [line:protected] => 9
    [trace:Exception:private] => Array
        (
        [0] => Array
            (
                [file] => /var/www/serverclient/stock.php
                [line] => 9
                [function] => __call
                [class] => SoapClient
                [type] => ->
                [args] => Array
                    (
                        [0] => getPrice
                        [1] => Array
                            (
                                [0] => GOOGLE
                            )

                    )

            )

        [1] => Array
            (
                [file] => /var/www/serverclient/stock.php
                [line] => 9
                [function] => getPrice
                [class] => SoapClient
                [type] => ->
                [args] => Array
                    (
                        [0] => GOOGLE
                    )

            )

    )

[previous:Exception:private] => 
[faultstring] => Function ("getPrice") is not a valid method for this service
[faultcode] => Client
[faultcodens] => http://schemas.xmlsoap.org/soap/envelope/

)

i have done the same changes as suggested in the comment but not able to call that method

any suggestions ? Thanks in advance

  • 写回答

1条回答 默认 最新

  • dsaxw4201 2014-02-11 03:09
    关注

    you must off the server cache for soap, u can off it by adding ini_set("soap.wsdl_cache_enabled", "0"); to your code

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂