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

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

报告相同问题?

悬赏问题

  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!
  • ¥15 怎样解决power bi 中设置管理聚合,详细信息表和详细信息列显示灰色,而不能选择相应的内容呢?
  • ¥15 QTOF MSE数据分析
  • ¥15 平板录音机录音问题解决