Home  >  Article  >  Backend Development  >  PHP怎么调用wsdl

PHP怎么调用wsdl

WBOY
WBOYOriginal
2016-06-13 12:57:531362browse

PHP如何调用wsdl
PHP如何调用wsdl,需要什么样的类,谁能给个详细的代码?谢谢
------解决方案--------------------
要看你的需求咯
------解决方案--------------------
$wsdl = "http://192.168.1.2/jaxws/services/test?wsdl";
$client = new SoapClient($wsdl);
$param = array('arg0'=>'arg0','arg1'=>'arg1');
$ret = $client->getUserinfoByID($param);
if ($ret->return){  print_r($ret->return);}
else{  echo 'no user';}

具体SoapClient需要php的soap支持,看phpinfo里有soap的话就可以了,
------解决方案--------------------
wsdl 是给用户看的接口规范
只要你调用的方法和参数是正确的,有没有 wsdl 都是一样的
------解决方案--------------------

引用:
我也是这样调用的,但还是报错

报什么错?
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