致命错误:调用非对象上的成员函数

发布于 2024-12-18 04:22:19 字数 911 浏览 2 评论 0原文

我使用此代码从 WebService 发送和获取商品价格:

require_once('lib/nusoap.php');

$username = 'myusername';
$password = 'mypassword';
$kol = '3000';
$weight = '200';
$state = '51';
$city = '8';
$type = '0';

$option = array('login' => $username , 'password' => $password);
$client = new SoapClient('http://www.wbservice.info/Webservice/wsdl.php',$option);
$soap = $client->getProxy(); 
$response = $soap -> GetSendPrice($kol , $weight , $state , $city , $type);
      echo $response;

但这会返回我此错误:

Fatal error: Call to a member function GetSendPrice() on a non-object in /sample.php on line 20

我尝试此代码:

$response = $soap ->call( 'GetSendPrice',array(30000 , 200 , 51 , 8 , 0));

返回我此错误:

Fatal error: Call to a member function call() on a non-object in /sample.php on line 21

谢谢

I use this code for send and get item price from WebService:

require_once('lib/nusoap.php');

$username = 'myusername';
$password = 'mypassword';
$kol = '3000';
$weight = '200';
$state = '51';
$city = '8';
$type = '0';

$option = array('login' => $username , 'password' => $password);
$client = new SoapClient('http://www.wbservice.info/Webservice/wsdl.php',$option);
$soap = $client->getProxy(); 
$response = $soap -> GetSendPrice($kol , $weight , $state , $city , $type);
      echo $response;

But thats returne me this error:

Fatal error: Call to a member function GetSendPrice() on a non-object in /sample.php on line 20

I try this code :

$response = $soap ->call( 'GetSendPrice',array(30000 , 200 , 51 , 8 , 0));

return me this error:

Fatal error: Call to a member function call() on a non-object in /sample.php on line 21

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与酒说心事 2024-12-25 04:22:19

问题似乎出在您正在调用的 Web 服务中,而不是您用来调用它的代码中。

It appears the problem is in the Webservice you are calling and not in the code you are using to call it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文