PHP错误SoapClient getProxy()

时间:2015-03-06 06:42:21

标签: php

使用soap服务时出现此错误:

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

这是我的代码:

<?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);
?>

我的代码有问题吗?

1 个答案:

答案 0 :(得分:0)

请查看PHP SoapClient Doku,没有getProxy-Method。客户端本身调用wsdl:

中定义的函数
$token = $client->GetToken();
$client->ListTable($token);

并设置shure,检查$ token,如果它真的是一个变量,或者它是一个对象。