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 (标签-STM32|关键词-智能小车)
  • ¥20 关于#stm32#的问题,请各位专家解答!
  • ¥15 (标签-python)
  • ¥15 第一个已完成,求第二个做法
  • ¥20 搭建awx,试了很多版本都有错
  • ¥15 java corba的客户端该如何指定使用本地某个固定IP去连接服务端?
  • ¥15 activiti工作流问题,求解答
  • ¥15 有人写过RPA后台管理系统么?
  • ¥15 Bioage计算生物学年龄
  • ¥20 如何将FPGA Alveo U50恢复原来出厂设置哇?