Home  >  Article  >  Backend Development  >  php 调用webservices错误,求指点

php 调用webservices错误,求指点

WBOY
WBOYOriginal
2016-06-23 13:47:23859browse

<?phpdefine('IN_ECS', true);//require($_SERVER['DOCUMENT_ROOT'].'/includes/init.php');require dirname(dirname(__FILE__)).'/includes/init.php';include dirname(__FILE__)."/nusoapClass/lib/nusoap.php";header('Content-Type: text/html; charset=GBK');/* * 调用java的接口 *  */$soap = new soapclient("http://192.168.5.120:8081/shopping2013/Dragon/Service.php?wsdl", true);$soap->soap_defencoding = 'UTF-8';$params = array('11');echo $soap->call('test',$params);?>

Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient() [soapclient.soapclient]: Invalid parameters in /opt/lampp/htdocs/shopping2013/Dragon/Client.php:12 Stack trace: #0 /opt/lampp/htdocs/shopping2013/Dragon/Client.php(12): SoapClient->SoapClient('http://192.168....', true) #1 {main} thrown in /opt/lampp/htdocs/shopping2013/Dragon/Client.php on line 12
这是什么错误,怎么处理


回复讨论(解决方案)

soapclient 是 php SOAP 扩展的类

nusoap.php 定义的是 soap_client 吧?

soapclient 是 php SOAP 扩展的类

nusoap.php 定义的是 soap_client 吧?


定义了两个class
class nusoap_base
class nusoap_client extends nusoap_base

不对,有好几个class
class nusoap_base
class nusoap_fault extends nusoap_base
class nusoap_xmlschema extends nusoap_base
class soapval extends nusoap_base
class soap_transport_http extends nusoap_base
class nusoap_server extends nusoap_base 
class wsdl extends nusoap_base 
class nusoap_parser extends nusoap_base
class nusoap_client extends nusoap_base

soap调用通过了,是你的client.php本身有问题,单独打开这个CLIENT。php,看看有么问题

soap调用通过了,是你的client.php本身有问题,单独打开这个CLIENT。php,看看有么问题

问题中贴出的错误就是访问client.php的错误吖

client.php是你内部项目错误,这不干WEBSERVICE什么事

亲,问题解决了吗

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn