douxiongye5779 2015-03-06 06:42
浏览 32
已采纳

PHP错误SoapClient getProxy()

Getting this error while using soap service php :

Fatal error: Uncaught SoapFault exception: [Client] Function ("getProxy") is not a valid method for this service in C:\webserver\www\feeder\index.php:7 Stack trace: #0 C:\webserver\www\feeder\index.php(7): SoapClient->__call('getProxy', Array) #1 C:\webserver\www\feeder\index.php(7): SoapClient->getProxy() #2 {main} thrown in C:\webserver\www\feeder\index.php on line 7

here's my code :

<?php 
$wsdl = "http://localhost:8182/fg/live.php?wsdl";

$username = "aaaaa";
$password = "123456";

$client = new SoapClient($wsdl);
$proxy = $client->getProxy();

$token = $proxy->GetToken($username, $password);
var_dump("Get Token = ".$token);

$table = $proxy->ListTable($token);
var_dump("Tabel = ".$table);
?>

There's something wrong with my code ?

  • 写回答

1条回答 默认 最新

  • douxieshang5577 2015-03-06 07:00
    关注

    Please have a look at the PHP SoapClient Doku, there is no getProxy-Method. The client itself calls the functions defined in wsdl:

    $token = $client->GetToken();
    $client->ListTable($token);
    

    And make shure, that you check $token, if it's really a single variable, or if it is an object.

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

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀