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 MATLAB动图问题
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题