dt2015 2013-12-07 00: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-10 19: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

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

报告相同问题?