致命错误:调用非对象上的成员函数
我使用此代码从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题似乎出在您正在调用的 Web 服务中,而不是您用来调用它的代码中。
It appears the problem is in the Webservice you are calling and not in the code you are using to call it.